Releases: AddSearch/js-client-library
Releases · AddSearch/js-client-library
v0.3.0
New functions to control Search Analytics:
- sendStatsEvent to send search queries and clicks to analytics
- setStatsSessionId and getStatsSessionId to manually control the search session ID or to share the ID between multiple client instances. Only the last keyword of a single session is shown on the Analytics Dashboard.
Deprecated searchResultClicked function and it should be replaced with sendStatsEvent:
// documentId is the 32-character long id that is part of each hit in search results.
// position is the position of the document that was clicked, the first result being 1
client.sendStatsEvent('click', keyword, {documentId: id, position: n});
v0.2.4
New functions to query custom field autocompletion and define the number of results to fetch.
client.setAutocompleteSize(20);
client.autocomplete('custom_fields.brand', 'a', callback); // "adidas, apple, azure"
New function to use a filtering object with complex setup.
var filter = {
'and':[
{'custom_fields.brand': 'apple'},
{'not': {'custom_fields.color': 'white'}},
{'range': {'custom_fields.price': {'gt': 200, 'lt':500}}}
]
};
client.setFilterObject(filter);
v0.2.3
v0.2.2
v0.2.1
Deprecated function
- useFuzzyMatch
Added function
- setFuzzyMatch with possible attribute values true, false, or "auto" (default is "auto" for automatic typo tolerance)
Added possibility to sort search results by custom_field. For example:
- client.setPaging(1, 10, 'custom_fields.price', 'asc'); // Lowest price first