AddSearch Search API Client for JavaScript
AddSearch is a hosted search platform for all your web content. This API
Client lets you easily use the AddSearch Search API
from your JavaScript code. This client works on web browsers and with Node.js.
Quick Start
var client = new AddSearchClient('YOUR PUBLIC SITEKEY');
var cb = function(res) {
console.log(res);
}
client.search('keyword', cb);
client.suggest('api', cb);
Publicly accessible functions
The client provides the following functions.
Fetch search results
client.search('keyword', callback);
client.search(callback);
Use fuzzy matching
client.useFuzzyMatch(false);
Define language filter
client.setLanguage('en');
Define publishing date filters
client.setDateFilter('2019-01-01', '2019-01-31');
Manage paging
client.setPaging(page, pageSize, sortBy, sortOrder);
client.nextPage();
client.previousPage();
Browser support
The client is tested on following browsers
- Chrome
- Firefox
- Edge
- Safari 6.1+
- Internet Explorer 10+
Development
To modify this client library, clone this repository to your computer and execute following commands.
Install dependencies
npm install
Run tests
npm test
Build
To build the client, run:
npm run build
Built bundle is saved under the dist/ folder