fullscale / elastic.js

A JavaScript implementation of the elasticsearch Query DSL
http://docs.fullscale.co/elasticjs/
MIT License
654 stars 163 forks source link

Problem with TermSuggester #31

Closed iulia-pasov closed 11 years ago

iulia-pasov commented 11 years ago

Hello,

I tried the term suggester and I always get the "term" option before the text in the suggest request, which generates an error in Elastic Search.

e.g. For

ejs.TermSuggester("my_suggestion")
            .text("geographoc")
            .field("title");

The suggest request will be:

"suggest":{"my_suggestion":{"term":{"field":"title"}, "text":"geographoc"}} 

instead of:

"suggest":{"my_suggestion":{"text":"geographoc", "term":{"field":"title"}}} 

Thanks, Iulia

mattweber commented 11 years ago

What version of elasticsearch are you using? I have tested with 0.90.3 and everything works as expected.

mattweber commented 11 years ago

As expected means it doesn't matter what order text or term option come in the suggest request.

iulia-pasov commented 11 years ago

I've been working with ES 0.90.2. I'll switch to 0.90.3. Thanks for the reply.