I have a common term query like so.
{
"query" : {
"common" : {
"DocumentData.OCR_Text" : {
"query" : "block 310 luis",
"cutoff_frequency" : 0.001
}
}
}
}
I want to search on 2 or more fields but this gives me an error.
{
"query" : {
"common" : {
"Grantors" : {
"query" : "block 310 luis",
"cutoff_frequency" : 0.001
},
"DocumentData.OCR_Text" : {
"query" : "block 310 luis",
"cutoff_frequency" : 0.001
}
}
}
}
nested: ElasticsearchParseException[Expected field name but got START_OBJECT "DocumentData.OCR_Text"];
How would you do this?
You should wrap it in a Bool Query
{
"query": {
"bool": {
"should": [
{
"common": {
"Grantors": {
"query": "block 310 luis",
"cutoff_frequency": 0.001
}
}
},
{
"common": {
"DocumentData.OCR_Text": {
"query": "block 310 luis",
"cutoff_frequency": 0.001
}
}
}
]
}
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With