YousefED / ElasticUI

AngularJS directives for Elasticsearch
http://www.elasticui.com
Other
526 stars 138 forks source link

Help with elastic.js syntax #86

Closed manateeit closed 8 years ago

manateeit commented 8 years ago

Yousef,

Can you help me translate what this should be in ejs?

GET /_search
{
  "query": {
    "bool": {
      "should": [
        { "match": { "title":  "War and Peace" }},
        { "match": { "author": "Leo Tolstoy"   }}
      ]
    }
  }
}
manateeit commented 8 years ago

Here is my guess, but its not working.

eui-query="ejs.BoolQuery().should(ejs.MatchQuery('title', 'War and Peace'),ejs.MatchQuery('author', 'Leo Tolstoy'))" 
YousefED commented 8 years ago

Try ejs.BoolQuery().should([ejs.MatchQuery("title", "War and Peacy"), ejs.MatchQuery("author", "Leo Tolstoy")])

On Thu, May 12, 2016 at 2:00 PM, Mediathread notifications@github.com wrote:

Here is my guess, but its not working.

eui-query="ejs.BoolQuery().should(ejs.MatchQuery('title', 'War and Peace'),ejs.MatchQuery('author', 'Leo Tolstoy'))"

— You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub https://github.com/YousefED/ElasticUI/issues/86#issuecomment-218736586

manateeit commented 8 years ago

Thank you!