Unable to search few keywords

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"
}
}
]
}
}
}

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.

You should test your analysis chain to make sure that the stemming is correct, that would be the first place to start :slight_smile:

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"
}
}
]
}
}
}

I don't think a stemming analyser will remove things like non-alpha characters in a query. You should use complete terms.

If i place * with query string it is only return data with Mountains* excluded Mountain related assets.

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 .

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"
}
}]
}
}]
}
}
}

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.