Stemmer filter not working as expected when search, wont find some exact words

I have a simple search field. The search results work strangely.. some search work as expected, other not. For example 'Building', if I search for the exact term, it wont find the search.
Other words, like for example 'retrofit', works.. even if I search for plural or misspelled.
To me, it seems like it wont find verbs.

I use the following settings:

{
"settings" : {
    "analysis" : {
        "analyzer" : {
            "my_analyzer" : {
                "tokenizer" : "standard",
                "filter" : ["lowercase", "stop", "stemmer"]
            }
        }
    }
}
}

The query is next (its in PHP):

$params = [

        'body'  => [
            'query' => [
                'match' => [
                    'teaming_desc' => [
                        'query' => $searchTerm,
                        'analyzer' => 'my_analyzer'
                    ]            
                ]
            ]
        ]
    ];

Welcome!

What is the mapping?

Could you provide a full recreation script as described in About the Elasticsearch category. It will help to better understand what you are doing. Please, try to keep the example as simple as possible.

A full reproduction script is something anyone can copy and paste in Kibana dev console, click on the run button to reproduce your use case. It will help readers to understand, reproduce and if needed fix your problem. It will also most likely help to get a faster answer.

Note that you might be using standard analyzer at index time and another one at search time which might produce weird behavior.

You can test that with the _analyze API.

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