I am trying to get results only stemming and synonyms data is available. want to remove if documents contain only exact match phrases.
Example:
Query: If I search loss
Result: I got 3 documents first document contains only loss and second document contains loss, waste and third document contains loss and losses So I want to remove one first documnet that only contains loss.
body: {
settings: {
index: {
"analysis":{
"analyzer":{
"my_analyzer": {
"tokenizer": "standard",
"filter": [
"lowercase",
]
},
"my_stemmer": {
"tokenizer": "standard",
"filter": [
"custom_english_stemmer"
]
},
"analyzer_synonym":{
"tokenizer":"standard",
"filter":[
"lowercase", "synonym"
]
}
},
"filter":{
"synonym":{
"type":"synonym_graph",
"synonyms_path":"synonyms.txt",
"updateable":true,
"lenient": true
},
"custom_english_stemmer": {
"type": "stemmer",
"name": "english"
}
}
}
}
mappings: {
properties: {
all_text: {
type: 'text',
search_analyzer: "analyzer_synonym",
analyzer: "my_analyzer",
fields: {
raw: { type: 'text'},
stemmer: {type: 'text', analyzer: "my_stemmer"}
}
},
#transcript: {
# type:'nested'
#}
}
}