itemsapi-node
Node.js client for ItemsAPI - node.js & elasticsearch search server for web and mobile. For more low level info go to documentation
$ npm install itemsapi-node --save
Init client:
var ItemsAPI = ;var client = 'http://yourLocalOrHerokuUrl.com/api/v1' 'cities';
Items
Search items
var facets = country:'Canada' 'India'; client
Example response:
meta: query: '' sort: 'most_votes' search_time: 20 pagination: page: '1' per_page: '12' total: 67 data: items: Object Object Object Object Object Object Object Object Object Object Object Object aggregations: country: Object distance_ranges: Object sortings: country: Object distance: Object city: Object
Similar items
client
Get item
client
Add item
client
Delete item
client
Add items in bulk
client
Collections
Get collection
client
Example response:
name: 'cities' type: 'cities' index: 'cities' meta: title: 'Cities' defaults: sort: 'city' schema: city: type: 'string' store: true index: 'not_analyzed' province: type: 'string' store: true province_icon: type: 'string' display: 'image' country: type: 'string' index: 'not_analyzed' store: true country_icon: type: 'string' display: 'image' geo: type: 'geo_point' sortings: country: title: 'Country' type: 'normal' order: 'asc' field: 'country' distance: title: 'Distance' type: 'geo' order: 'asc' field: 'geo' city: title: 'City' type: 'normal' order: 'asc' field: 'city' table: {} aggregations: country: type: 'terms' field: 'country' size: 10 title: 'Country' distance_ranges: type: 'geo_distance' field: 'geo' ranges: Object unit: 'km' title: 'Distance ranges [km]'
Add collection
client
Get all collections
client
Update collection partially
client