diff --git a/README.md b/README.md index 61eeed2..0a37e60 100644 --- a/README.md +++ b/README.md @@ -80,8 +80,8 @@ All Features:
Type | -Complexity | +Type | +Complexity |
Each single term query: | -1 | +Each single term query: | +1 |
Lexical Pre-Scored Dictionary (Solo): | -TERM_COUNT * TERM_MATCHES | +Lexical Pre-Scored Dictionary (Solo): | +TERM_COUNT * TERM_MATCHES |
Lexical Pre-Scored Dictionary + Context-based Map: | -TERM_MATCHES / TERM_COUNT | +Lexical Pre-Scored Dictionary + Context-based Map: | +TERM_MATCHES / TERM_COUNT |
- | BulkSearch | -FlexSearch | ++ | BulkSearch | +FlexSearch | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Access | @@ -762,6 +762,8 @@ index.search("John", { }); ``` +See all available custom search options. + #### Pagination @@ -1409,6 +1411,8 @@ var results = index.search([{ ``` --> +See all available field-search options. + ## Logical Operators @@ -1616,10 +1620,12 @@ var results = index.search("John", { > The default sorting order is from lowest to highest. + Sort by a custom function: ```js @@ -1681,7 +1687,7 @@ Create index and just set a limit of cache entries: var index = new FlexSearch({ profile: "score", - cache: 10000 + cache: 1000 }); ``` @@ -1690,7 +1696,7 @@ var index = new FlexSearch({ > When just using "true" the cache is unbounded and perform actually 2-3 times faster (because the balancer do not have to run). -## WebWorker Sharding (Browser only) +## Web-Worker (Browser only) Worker get its own dedicated memory and also run in their own dedicated thread without blocking the UI while processing. Especially for larger indexes, web worker improves speed and available memory a lot. FlexSearch index was tested with a 250 Mb text file including 10 Million words. @@ -1734,18 +1740,20 @@ index.search("John Doe").then(function(results){ ## Options -FlexSearch ist highly customizable. Make use of the the right options can really improve your results as well as memory economy or query time. +FlexSearch ist highly customizable. Make use of the the right options can really improve your results as well as memory economy and query time. + +### Initialize Index
Option | -Values | -Description | +Option | +Values | +Description |
profile |
- + | profile |
+
"memory" "speed" "match" @@ -1759,8 +1767,8 @@ FlexSearch ist highly customizable. Make use of the the right | ||
tokenize |
- + | tokenize |
+
"strict" "forward" "reverse" @@ -1774,8 +1782,8 @@ FlexSearch ist highly customizable. Make use of the the right | ||
split |
- + | split |
+
RegExp string |
@@ -1785,7 +1793,7 @@ FlexSearch ist highly customizable. Make use of the the right
||
encode |
+ encode |
false "icase" @@ -1799,7 +1807,7 @@ FlexSearch ist highly customizable. Make use of the the right | |||
cache |
+ cache |
false true @@ -1809,7 +1817,7 @@ FlexSearch ist highly customizable. Make use of the the right | |||
async |
+ async |
true false @@ -1818,7 +1826,7 @@ FlexSearch ist highly customizable. Make use of the the right | |||
worker |
+ worker |
false {number} @@ -1827,7 +1835,7 @@ FlexSearch ist highly customizable. Make use of the the right | |||
depth |
+ depth |
false {number} @@ -1836,7 +1844,7 @@ FlexSearch ist highly customizable. Make use of the the right | |||
threshold |
+ threshold |
false {number} @@ -1845,7 +1853,7 @@ FlexSearch ist highly customizable. Make use of the the right | |||
resolution | +resolution | {number} | @@ -1853,7 +1861,7 @@ FlexSearch ist highly customizable. Make use of the the right|||
stemmer |
+ stemmer |
false {string} @@ -1863,7 +1871,7 @@ FlexSearch ist highly customizable. Make use of the the right | |||
filter |
+ filter |
false {string} @@ -1873,7 +1881,7 @@ FlexSearch ist highly customizable. Make use of the the right | |||
rtl |
+ rtl |
true false @@ -1882,13 +1890,115 @@ FlexSearch ist highly customizable. Make use of the the right |
Option | +Values | +Description | +
limit | +number | +Sets the limit of results. | +
suggest | +true, false | +Enables suggestions in results. | +
where | +object | +Use a where-clause for non-indexed fields. | +
field | +string, Array<string> | +Sets the document fields which should be searched. When no field is set, all fields will be searched. Custom options per field are also supported. | +
bool | +"and", "or" | +Sets the used logical operator when searching through multiple fields. | +
page | +true, false, cursor | +Enables paginated results. | +
Option | +Values | +Description | +
limit | +number | +Sets the limit of results per field. | +
suggest | +true, false | +Enables suggestions in results per field. | +
bool | +"and", "or", "not" | +Sets the used logical operator when searching through multiple fields. | +
boost | +number | +Enables boosting fields. | +
Option | -Description | -Example | -Memory Factor (n = length of word) | +Option | +Description | +Example | +Memory Factor (n = length of word) | |||||||||||||||||||||||||||||||||||
"strict" | @@ -1951,10 +2061,10 @@ Encoding effects the required memory also as query time and phonetic matches. Tr
Option | -Description | -False-Positives | -Compression | +Option | +Description | +False-Positives | +Compression | ||||||||||||||||||||||||||
false | @@ -2007,11 +2117,11 @@ Encoding effects the required memory also as query time and phonetic matches. Tr
Query | -icase | -simple | -advanced | -extra | +Query | +icase | +simple | +advanced | +extra | |||||||||||||
björn | @@ -2117,8 +2227,8 @@ The required memory for the index depends on several options:
Encoding | -Memory usage of every ~ 100,000 indexed word | +Encoding | +Memory usage of every ~ 100,000 indexed word | ||
false | @@ -2145,8 +2255,8 @@ The required memory for the index depends on several options:90 kb | ||||
Mode | -Multiplied with: (n = average length of indexed words) | +Mode | +Multiplied with: (n = average length of indexed words) | ||
"strict" | @@ -2175,8 +2285,8 @@ The required memory for the index depends on several options:* n * (n - 1) | ||||
Contextual Index | -Multiply the sum above with: | +Contextual Index | +Multiply the sum above with: | ||
@@ -2564,8 +2674,8 @@ node compile SUPPORT_WORKER=true |
Flag | -Values | +Flag | +Values |
DEBUG |