angularjs - How to integrate Elastic Search with Meanjs (Mongodb ,Express,Angular,Nodejs) -
I have installed MEANJS with pain, its current module are working properly The point is that with the angular search I I'm trying to integrate flexible search. But no suitable solution was found. When I am adding elastic detection to server.js then shows search results on the terminal. How to display search results via angular js on the home page.
I also want to add elastic databases to the MongoDub database so elastic search automatically updates. Any suggestion is very useful for me to connect via elastic search.
var MyOpenRecipes = angular.module ('myOpenRecipes', ['elasticsearch'], ['$ locationProvider' , Function ($ locationProvider) {$ locationProvider.HTML5Mode (true);}]); MyOpenRecipes.factory ('recipe q', 'esfactory', '$ location', function ($ q, elasticsearch, $ location) {var client = elasticsearch ({host: $ location.host ()} ": 9 0000"} ); ** ** Load one more round of 10 recipes, looking at one word and one offset. * * Promises. * / Var search = function (word, offset) {var deferred = $ q.defer) ; Var query = {"match": {"_all": term}}; Client.search ({"index": 'features', "type": 'feature', "body": {"size": 10, "to": (offset || 0) * 10, "query": query }}) Then (function (results) {var ii = 0, hits_in, hits_out = []; hits_in = (result.hits || {}). (; Ii & lt; hit_in lamps; ii for hit || ++) {hits_out.push (hits_in [ii] ._ source);} suspended.rolove (h) it is out); }, Deferred.reject); Refund refund. }; Return {"search": search}; }];
Basically what you want to do:
- Run an elastic search (ES) server.
- On your server-side code (MEAN), you will write a route that handles search.
- Send your corner code to your backend route which searches through ES.
You do not want to speak directly to the ES on the Axis network - there is no way to do this with AAAIEF safely.
Comments
Post a Comment