pchinta
(pavan chinta)
May 22, 2017, 12:33pm
1
I am unable to search few assets with below keyword.
mountains , this is not picking up mountain.
Already i created search analyser as below on assets by seeing documentation.
http://localhost:9200/assets
{
"settings": {
"analysis" : {
"analyzer" : {
"my_analyzer" : {
"tokenizer" : "standard",
"filter" : ["standard", "lowercase", "my_stemmer"]
}
},
"filter" : {
"my_stemmer" : {
"type" : "stemmer",
"name" : "english"
}
}
}
}
}
Suggest me how to implement this ?
I queried back with below request.
{
"query":{
"bool":{
"must":[
{
"query_string":{
"default_field":"_all",
"query":"mountains*",
"analyzer":"my_analyzer"
}
}
]
}
}
}
pchinta
(pavan chinta)
May 24, 2017, 6:05am
2
Appreciate if some one throw some light on this, i am new to elastic search.
Though i set language analyzer it did not works for me.
warkolm
(Mark Walkom)
May 24, 2017, 8:48am
3
You should test your analysis chain to make sure that the stemming is correct, that would be the first place to start
pchinta
(pavan chinta)
May 24, 2017, 9:32am
4
Thanks Warkolm for your response.
I can able to search Mountain with below request, But if i want to return assets with Mountains* can i send multiple string or what was the approch ?
{
"query":{
"bool":{
"must":[
{
"query_string":{
"default_field":"_all",
"query":"Mountains",
"analyzer":"my_analyzer"
}
}
]
}
}
}
warkolm
(Mark Walkom)
May 24, 2017, 9:43am
5
I don't think a stemming analyser will remove things like non-alpha characters in a query. You should use complete terms.
pchinta
(pavan chinta)
May 24, 2017, 9:51am
6
If i place * with query string it is only return data with Mountains* excluded Mountain related assets.
pchinta
(pavan chinta)
May 24, 2017, 10:48am
8
Hi Warkolm,
I tested all the analyzers and tokenizers but unable to found solution.
If query is mountains* it is returning mountains only and leaving mountain asset .
pchinta
(pavan chinta)
May 25, 2017, 1:44pm
9
Finally i can able to solve this by multiple query's.
{
"query": {
"bool": {
"must": [{
"bool": {
"should": [{
"query_string": {
"default_field": "_all",
"query": "Flowers*"
}
}, {
"query_string": {
"default_field": "_all",
"query": "Flowers",
"analyzer":"my_analyzer"
}
}]
}
}]
}
}
}
system
(system)
Closed
June 22, 2017, 1:45pm
10
This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.