HI,
I had 20k documents ingested in ES 2.4.1 Cluster.
Usecase: I need to find all the documents in an index which has book_ID = "value1"
and it should search for the documents whose region_ID
falls in [Array of Values].
My Mappings:
"BookList": {
"type": "nested",
"include_in_parent": true,
"properties": {
"bookName": {
"type": "string",
"index": "not_analyzed"
},
"book_ID": {
"type": "long"
},
"region_ID": {
"type": "long"
},
}
NOTE: In 1 document i will have number of BookList's.
The query i am sending:
{"size":1332,"query":{"nested":{"query":{"bool":{"must":[{"term":{"BookList.book_ID":{"value":101639}}},{"terms":{"BookList.region_ID":[Passing Array of Values]}}]}},"path":"BookList"}}}
I am facing error like too_many_clauses: maxClauseCount is set to 1024
, and came to know that Lucene has a limit of 1024 terms in a query clause .
Questions:
- How can i overcome it ?
- Is it a good practice to send that many count in terms query?
Thanks