matteodem / meteor-easy-search

Easy-to-use search for Meteor with Blaze Components
MIT License
438 stars 68 forks source link

Search is not working with elastic search engine #572

Closed Nits7029 closed 7 years ago

Nits7029 commented 7 years ago

this is my indexCode:

import { Index } from 'meteor/easy:search'
import { ElasticSearchEngine } from 'meteor/easysearch:elasticsearch'

 RoomsIndex = new Index({

 engine: new ElasticSearchEngine({
    body: (a,b,c) => {}
  }),
 collection: Rooms,
 fields:  ['roomName', 'roomType','speciality']
});

rooms.html template code:

  {{> EasySearch.Input index=roomsIndex}}
                    <ul>
                        {{#EasySearch.Each index=roomsIndex}}
                        <li>Name of the player: {{roomName}} - {{roomType}} - {{speciality}}</li>
                        {{/EasySearch.Each}}
                    </ul>

rooms.js code:

this is helper code:

  roomsIndex:function(){
      return RoomsIndex ;
    }
matteodem commented 7 years ago

Is elasticsearch running locally?

Nits7029 commented 7 years ago

on page load time data shows but when i type search string in search box it is not work. it gives me all record which i have. capture

Nits7029 commented 7 years ago

yes, elasticsearch is running locally

bompi88 commented 7 years ago

Does returning a inside the body function work? If the body function is defined, you'll have to return the actual ES-body which will be used by the ES-client.

matteodem commented 7 years ago

If this is still a problem please provide a reproduction repository or steps. Will re-open if provided