Hi ,
I am facing issue in synonyms where search with substring like "raju t"
I synonym file i have given synonyms like below.
srinivas m,srinivas muriki,mahesh kumar,manasa muriki=>Lajawaab
"raju tal"=>Lajawaab
Television,TV=>TV
TV=>Television
when I search with "raju tal" i am getting results .
But When I search with substring of raju tal i am not gettin results.
Below are the mapping and setting .
DELETE hotstar_autosuggestion
PUT hotstar_autosuggestion
{
"settings": {
"analysis": {
"analyzer": {
"keyword_edge":{
"type":"custom",
"tokenizer":"standard",
"filter":[
"ngramone",
"lowercase"
]
},
"search_standard_edge":{
"type":"custom",
"tokenizer":"standard",
"filter":["my_synonym_filter","ngramone","lowercase"]
}
},
"filter": {
"my_synonym_filter": {
"type": "synonym",
"synonyms_path" : "synonyms.txt"
},
"ngramone": {
"type": "edge_ngram",
"min_gram": 1,
"max_gram": 30 ,
"token_chars":[
"letter",
"digit",
"punctuation",
"symbol"
]
}
}
}
},
"mappings": {
"hotstar":{
"properties": {
"title":{
"fields": {
"titleone":{
"type": "string"
},
"titletwo":{
"type": "string"
}
},
"type": "multi_field"
},
"search_keywords":{
"type": "string"
}
}
}
}
}
POST hotstar_autosuggestion/_analyze
{
"analyzer":"comma_analyzer",
"text":"srilatha,edula"
}
POST /hotstar_autosuggestion/hotstar/_bulk
{ "index": { "_id": 22}}
{ "title": "capgemini manasa muriki","search_keywords":["horror Movies","mythology movies"]}
{ "index": { "_id": 21}}
{ "title": "manasa muriki","search_keywords":["horror Movies","mythology movies"]}
{ "index": { "_id": 25}}
{ "title": "raju tal","search_keywords":["horror Movies","mythology movies"]}
{ "index": { "_id": 24}}
{ "title": "telugu television","search_keywords":["horror Movies","mythology movies"]}
{ "index": { "_id": 23}}
{ "title": "telugu tv","search_keywords":["horror Movies","mythology movies"]}
{ "index": { "_id": 19}}
{ "title": "accenture solutions pvt limited","search_keywords":["horror Movies","kannada movies"]}
{ "index": { "_id": 20}}
{ "title": "srinivas muriki accenture private siana","search_keywords":["English Movies","Telugu Movies"]}
{ "index": { "_id": 18}}
{ "title": "srinivas muriki accenture private siana","search_keywords":["English Movies","Telugu Movies"]}
{ "index": { "_id": 17}}
{ "title": "srinivas muriki siana","search_keywords":["English Movies","Telugu Movies"]}
{"index": { "_id": 16}}
{ "title": "srinivas muriki siana chaik","search_keywords":["English Movies","Telugu Movies"]}
{ "index": { "_id": 10}}
{ "title": "hum saath deena saath hain","search_keywords":["English Movies","Telugu Movies"]}
{ "index": { "_id": 12}}
{ "title": "srinivas muriki","search_keywords":["English Movies","Telugu Movies"]}
{ "index": { "_id": 13}}
{ "title": "srilatha edula accenture","search_keywords":["English Movies","Telugu Movies"]}
{"index": { "_id": 14}}
{ "title": "accenture private limited","search_keywords":["English Movies","Telugu Movies"]}
{ "index": { "_id": 15}}
{ "title": "team srilatha edula accenture","search_keywords":["English Movies","Telugu Movies"]}
{ "index": { "_id": 11}}
{ "title": "Aur Baati Hum","search_keywords":["English Movies","Telugu Movies"]}
{ "index": { "_id": 1}}
{ "title": "Aur Baati Hum","search_keywords":["English Movies","Telugu Movies"]}
{ "index": { "_id": 2}}
{ "title": "Ek Boond Ishq","search_keywords":["Hindi Movies","Malayalam Movies"]}
{ "index": { "_id": 3}}
{ "title": "diya aur baati hum","search_keywords":["Drama Movies","Comedy Movies"]}
{ "index": { "_id": 4}}
{ "title": "Sanyukta-Randhir: His versus Hers!","search_keywords":["family Movies","action Movies"]}
{ "index": { "_id": 5}}
{ "title":"Tara-Mrityunjay Sizzle up","search_keywords":["horror Movies","kannada Movies"]}
{ "index": { "_id": 6}}
{ "title":"Kalavati steals the show","search_keywords":["mythology Movies","kannada Movies"]}
{ "index": { "_id": 7}}
{ "title":"Lajawaab Laajo","search_keywords":["tamil Movies","marati Movies"]}
{ "index": { "_id": 8}}
{ "title": "Sandhya-Sooraj draw closer","search_keywords":["gujarathi Movies","marati Movies"]}
{ "index": { "_id": 9}}
{ "title":"Ishita & Raman""s Bond","search_keywords":["action Movies","marati Movies"]}
POST hotstar_autosuggestion/hotstar/_search
{
"query" : {
"bool": {
"should": [
{
"match_phrase_prefix": {
"title.titleone": "raju tal"
}
},
{
"match_phrase_prefix": {
"search_keywords": "raju tal"
}
},
{
"match_phrase": {
"title.titletwo": {
"query": "raju tal",
"analyzer": "search_standard_edge"
}
}
}
]
}
}
}