I am trying to achieve "AND" in filter .
Example: All those documents which has "PL" AND "rall" in there TAGS field.
Please let me know where I am wrong ?
My Query:
{
"query": {
"function_score": {
"query": {
"bool": {
"should": [
{
"query_string": {
"fields": [
"TITLE.title^5.5",
"TITLE.ngrams_front^2"
],
"analyzer": "titles_default_analyzer",
"query": "visa"
}
},
{
"fuzzy": {
"TITLE.title": {
"value": "visa",
"boost": 2,
"max_expansions": 20,
"prefix_length": 0
}
}
},
{
"query_string": {
"fields": [
"SEARCHABLE.title^1.5",
"SEARCHABLE.ngrams_front^1"
],
"analyzer": "titles_default_analyzer",
"query": "visa"
}
},
{
"fuzzy": {
"SEARCHABLE.title": {
"value": "visa",
"boost": 1,
"max_expansions": 20,
"prefix_length": 0
}
}
},
{
"match_phrase_prefix": {
"TITLE.title": {
"query": "visa",
"boost": 100
}
}
}
],
"filter": {
"bool": {
"must": [
{
"terms": {
"TAGS": [
"PL"
]
}
},
{
"terms": {
"TAGS": [
"rall"
]
}
}
]
}
}
}
},
"field_value_factor": {
"field": "BST_SCR_HGH",
"modifier": "log"
}
}
}
}