Hello everybody,
I'm new to elastic search and trying to work my way with it since a couple 
of weeks.
I'm using the node.js client 
(https://github.com/elasticsearch/elasticsearch-js) and as I proceed in my 
journey I'm facing quite a bit of problems with the DSL as I'm often 
confused by it's syntax.
What bothers me the most is I can't seems to be able to come up with simple 
and elegant queries.
For example, while trying to use filters the only way I was able to make 
them work was with something like:

{
  "index": "<some index>",
  "body": {
    "query": {
      "filtered": {
        "query": {
          "query_string": {
            "query": "<query string>"
          }
        },
        "filter": {
          "and": {
            "filters": [
              {
                "terms": {
                  "<someProperty.someKey>": [
                    "<some value>"
                  ]
                }
              },
              {
                "terms": {
                  "<someOtherProperty.someKey>": [
                    "<some value>"
                  ]
                }
              }
            ]
          }
        }
      }
    }
  }
}

It was kind of hard to produce and harder to understand the next day.
Do you have any suggestion on how to better approach the DSL?

thank you, best regards
lucio




-- 
You received this message because you are subscribed to the Google Groups 
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to elasticsearch+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elasticsearch/f0b73504-3979-4bdf-aefd-482dd33aa809%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to