I have created a following mapping and I loaded and indexed some documents . I ran the following query but I am not getting any results
I am filtering data on the text field . Does filter works on the text field ?
If not how to use a filter on the text fields .
PUT myidex/test
{
"settings":{
"analysis":{
"analyzer":{
"lowercase_analyzer":{
"type":"custom",
"tokenizer":"standard",
"filter":[
"lowercase"
]
},
"generic_description_analyzer": {
"type": "custom",
"tokenizer": "icu_tokenizer",
"filter": [
"word_split",
"icu_folding",
"english_stop"
]
}
},
"filter":{
"english_stop":{
"type":"stop",
"stopwords":"_english_"
},
"word_split": {
"type": "word_delimiter",
"preserve_original": 1
}
}
}
},
"mappings":{
"test":{
"properties": {
"weight": {
"type":"text",
"analyzer":"lowercase_analyzer",
"search_analyzer":"generic_description_analyzer"
}
,
"flavour":{
"type":"text",
"analyzer":"lowercase_analyzer",
"search_analyzer":"generic_description_analyzer"
}
,
"pack":{
"type":"text",
"analyzer":"lowercase_analyzer",
"search_analyzer":"generic_description_analyzer"
},
"category":{
"type":"text",
"index": "not_analyzed"
},
"brand":{
"type":"text",
"index": "not_analyzed"
}
,
"globalbrandextension":{
"type":"text",
"index": "not_analyzed"
},
"localbrand":{
"type":"text",
"index": "not_analyzed"
}
,
"productidentifier":{
"type":"text",
"index": "not_analyzed"
}
}
}
}
}
My search query
GET myidex/test/_search
{
"query": {
"bool": {
"should": [
{
"multi_match": {
"query": "MYBRAND APPLE JUICE 330ml",
"fields": ["weight","flavour","pack"]
}
}
]
,
"filter": [
{ "term": { "brand": "MYBRAND" }},
{ "term": { "globalbrandextension": "MYBRAND" }},
{ "term": { "productidentifier": "MYBRAND APPLE JUICE & DRINK" }}
]
}
}
}