PrefixQuery and Analyzer


#1

Hey gurus,

Quick/Dumb question from a newbie here. I have an field analyzer (asciifolding mostly) that works great for analysys of terms (these are actually people's names). But when using the PrefixQuery - it doesn't appear that the query text is going through the same analysis. I've seen postings that this is the case with a PrefixQuery. Is this so? Is there any way around this? Any info would be beneficial

Cheers!

Simi


(Isabel Drost-Fromm) #2

To cite https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-prefix-query.html

Matches documents that have fields containing terms with a specified prefix (not analyzed).

Others may correct me if I'm wrong here,
Isabel


#3

Thanks for the reply - if I understand then it is not analyzed. So is there a work-around? RIght now, the folding (asciifolding) is removing the special characters (diacritic, etc). - but the search query is not going through the same filter chain. So when a user type's in a name that has these special characters it won't find them since the folder has already removed them in the indexing. Is there a method in ElasticSearch, using a PrefixQuery, that I can filter these characters prior to the query? In which case, even if the use sends in these characters, they are "folded" prior to going against the index.

Again, I'm really new at this so I apologize if this is a simple question.

Cheers!

Simi


(system) #4