Does node package support browser use now?


(radhe) #1

Does elasticsearch.js package support browser use now?


(Alexander Reelsen) #2

The official node.js package is supported in the browser, see https://www.npmjs.com/package/elasticsearch. Is there any specific question?


(radhe) #3
function newAutocomplete(){

    var client = new $.es.Client({
          hosts: 'localhost:9200'
        });
    client.search({
	index: 'user',
	body: {
		suggest: {
			suggestion: {
				prefix: 'Rit',
				completion: {
					field: 'suggest'
				}
			}
		}
		}
}).then(function (resp) {
	var hits = resp.hits.hits;
}, function (err) {
	console.trace(err.message);
});
}

From above code I want to store output(suggestion) in an array, How can I do that?


(system) #4

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.