Skip to content

Releases: AddSearch/js-client-library

v0.5.0

19 Aug 06:26
Compare
Choose a tag to compare

Added functions to use Indexing API to create, update, fetch, and delete single documents or batches of documents. The full indexing API documentation can be found at addsearch.com

Example of indexing a document:

// Define a document (schemaless)
const doc = {
  custom_fields: {
    'name': 'Example product',
    'description': 'Description for the example product',
    'price_cents': 599,
    'average_customer_rating': 4.5
  }
};

// Save the document
client.saveDocument(doc)
  .then(response => {
    console.log(response);
  })
  .catch(error => {
    console.log(error);
  });

v0.4.3

16 Apr 11:32
Compare
Choose a tag to compare

Added support for field statistics. With this feature, you can add minimum, maximum, and average values of numerical or date-based custom fields to the search response. See documentation

v0.4.2

15 Apr 10:17
Compare
Choose a tag to compare

Added support for range facets. The feature can be used to group numerical custom fields into range buckets. See documentation

v0.4.1

07 Apr 10:17
Compare
Choose a tag to compare

A new function to control if postfix wildcard (i.e. keyword*) is used or not.

client.setPostfixWildcard(false);  

v0.4.0

03 Apr 12:13
Compare
Choose a tag to compare

New fuzzy search mode: Retry. Shows exact matches only. If none are found, a fuzzy search is fired automatically

// Show exact matches only. If none were found, show fuzzy matches
client.setFuzzyMatch('retry');

v0.3.1

16 Mar 08:51
Compare
Choose a tag to compare

Added throttling to API calls and a function to control the throttle time

// Set API call throttle time in milliseconds. Default is 200.
client.setThrottleTime(500);

v0.3.0

13 Mar 08:19
9d8dc11
Compare
Choose a tag to compare

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

11 Feb 14:16
Compare
Choose a tag to compare

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

23 Jan 12:06
Compare
Choose a tag to compare

New function to post search result clicks to analytics. Clicks are shown on your Analytics Dashboard and they can be used for the self-learning search algorithm.

  • searchResultClicked

v0.2.2

07 Jan 12:10
Compare
Choose a tag to compare

New function to disable analytics collection from API calls

  • setCollectAnalytics