matteodem / meteor-easy-search

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

Adjust default elasticsearch query #587

Closed matteodem closed 7 years ago

matteodem commented 7 years ago

fuzzy like this queries don't exist anymore. a PR is gladly appreciated here, basically just have to adjust following lines here: https://github.com/matteodem/meteor-easy-search/blob/master/packages/easysearch:elasticsearch/lib/engine.js#L62

AdrianAbba commented 7 years ago

the fields parameter doesnt exist anymore too :/

"The fields parameter has been replaced by stored_fields. The stored_fields parameter will only return stored fields — it will no longer extract values from the _source."

https://www.elastic.co/guide/en/elasticsearch/reference/5.2/breaking_50_search_changes.html#_literal_fields_literal_parameter

bompi88 commented 7 years ago

@AdrianAbba this should help if you're using ES 5.x:

body: function (body, opts) {
  return {
    query: body.query,
    stored_fields: body.fields
  };
}