matteodem / meteor-easy-search

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

Example for integration with elasticsearch #580

Closed Sam-Olendi closed 7 years ago

Sam-Olendi commented 7 years ago

I'm a noob and having trouble with configuring the engine to be elasticsearch. The documentation doesn't seem to have a clear example for elasticsearch that a beginner can easily follow.

What I have so far is this:

ArtistsIndex = new Index({
    collection: Artists,
    fields: ['name'],
    engine: new ElasticSearchEngine({
        client: {
            host: '127.0.0.1:9200'
        },
        query: function () {
            // what goes in here?
        }
    })
});

What am I meant to specify within the query? Everything I've tried results in a myriad of errors such as: [parsing_exception] no [query] registered for [fuzzy_like_this] or [parsing_exception] [name] query malformed, no start_object after query name or [parsing_exception] The field [fields] is no longer supported, please use [stored_fields] to retrieve stored fields or _source filtering if the field is not stored

AdrianAbba commented 7 years ago

if u are using the newst version of elasticsearch i guess u have to use smt else then "fuzzy_like_this",

https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-flt-field-query.html

they removed this query

matteodem commented 7 years ago

closing as covered by #587