@@ -57,18 +57,33 @@ client.search();
5757```
5858
5959#### Fetch search suggestions
60+ Search suggestions are keywords and search phrases that real users have used in your search. Configure Search
61+ suggestions on AddSearch Dashboard before using this function.
6062``` js
61- // Configure Search suggestions on AddSearch Dashboard first
6263// Get suggestions starting with a specific prefix
6364client .suggestions (' a' , callback);
6465```
6566
66- #### Number of search suggestions
67+ #### Set the number of search suggestions to fetch
6768``` js
6869// Number of search suggestions to fetch (default 10)
6970client .setSuggestionsSize (20 );
7071```
7172
73+ #### Fetch custom field autocompletion
74+ Custom fields autocomplete can be used for predictive search. For example, product names or categories can be
75+ suggested as the keyword is being typed in.
76+ ``` js
77+ // Fetch custom field values starting with a specific prefix. In this example, results could be "adidas, apple, azure"
78+ client .autocomplete (' custom_fields.brand' , ' a' , callback);
79+ ```
80+
81+ #### Set the number of custom field autocompletion results to fetch
82+ ``` js
83+ // Number of autocompletion results to fetch (default 10)
84+ client .setAutocompleteSize (20 );
85+ ```
86+
7287#### Search with fuzzy matching
7388``` js
7489// Enable/disable fuzzy matching. Possible values true/false/"auto" (default: "auto")
@@ -163,6 +178,22 @@ client.removeCustomFieldFilter('city','paris');
163178client .removeCustomFieldFilter (' city' );
164179```
165180
181+ #### Set filtering object
182+ Set complex filtering object that can contain nested * and* , * or* , * not* , and * range* filters.
183+
184+ ``` js
185+ // Find results where brand is apple, color is not white, and price is between 200 and 500
186+ var filter = {
187+ ' and' : [
188+ {' custom_fields.brand' : ' apple' },
189+ {' not' : {' custom_fields.color' : ' white' }},
190+ {' range' : {' custom_fields.price' : {' gt' : 200 , ' lt' : 500 }}}
191+ ]
192+ };
193+
194+ client .setFilterObject (filter);
195+ ```
196+
166197#### Manage paging
167198Set page number, page size and sorting parameters. It's possible to order results by:
168199- relevance (descending)
0 commit comments