I have a product catalog which I am indexing in ElasticSearch using the Elastica client.
While implementing search, I was appending *
after the typed search terms so that when one types whis
or whisk
he will already start seeing search results for whisky
.
But I want to show results for poster
when one types posters
as well.
I was able to achieve the plural to singular result using snowball
filter. But for that to work, I have to remove *
.
This is bad because there are no results to show until a full word is entered.
Any ideas how I can go about this? My analyzer code: (taken from here)
'analysis' => array(
'analyzer' => array(
'indexAnalyzer' => array(
'type' => 'custom',
'tokenizer' => 'whitespace',
'filter' => array('lowercase', 'mySnowball')
),
'searchAnalyzer' => array(
'type' => 'custom',
'tokenizer' => 'whitespace',
'filter' => array('lowercase', 'mySnowball')
)
),
'filter' => array(
'mySnowball' => array(
'type' => 'snowball',
'language' => 'English'
)
)
)