elasticsearch - Adding a condition to query -


i have query works grate. how ever need add 1 condition. want documents have field "marked" :"true"

this query.

{   "from": 0,   "size": 100,   "min_score": 0.6,   "query": {        "bool": {           "should": [               { "multi_match" : {                   "fields" : ["_all"],                   "query" : " test " ,                   "fuzziness" : "1.5" ,                   "prefix_length" : "2"                }             }           ],           "must": { "bool": { "must": [               { "terms": { "language.id":["1"] }},               { "term": { "forbidden":"false" }}          ]         }}}    },  "sort": [{ "_score": { "order": "desc"}} ] } 

i have been trying ti add should clause after both must clauses. can put condition?

try

{   "query": {     "bool": {       "should": [         {           "multi_match": {             "fields": [               "_all"             ],             "query": " test ",             "fuzziness": "1.5",             "prefix_length": "2"           }         }       ],       "must": [         {           "terms": {             "language.id": [               "1"             ]           }         },         {           "term": {             "forbidden": "false"           }         },         {           "term": {             "marked": "true"           }         }       ]     }   } } 

Comments

Popular posts from this blog

java - Jasper subreport showing only one entry from the JSON data source when embedded in the Title band -

mapreduce - Resource manager does not transit to active state from standby -

serialization - Convert Any type in scala to Array[Byte] and back -