Hi,
I'm new to Elasticsearch and try to integrate it into our project but met a
problem. In our data source, it has two fields: mode and schedule which are
all integer. Through UI, it should can query records based on these two
fields like:
SELECT * FROM doc WHERE mode = 1 AND (schedule = 1 OR schedule = 3)
I tried below query JSONs but none return the expected results, anyone can
help? Thank you!
{
- "query": {*
- "bool": {*
-
"must": [*
-
{ "match": { "mode": 1 } }*
-
],*
-
"should": [*
- { "match": { "schedule": 1 } },*
-
{ "match": { "schedule": 3 } }*
-
]*
- }*
- }*
}
{ "query": { "filtered": { "query": { "match_all": {} },
"filter": { "and" : [ { "term"
: { "mode" : "1" } } ] }, "filter":
{ "and" : [ { "term" : {
"schedule" : "1" } }, { "term" : {
"schedule" : "3" } } ] } } }}
--
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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/45bd7de6-ffe9-4d9f-bef6-be11e19b051f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.