Are Wildcard, Prefix, and Fuzzy queries case sensitive?

Otis Gospodnetic

Yes, unlike other types of Lucene queries, Wildcard, Prefix, and Fuzzy queries are case sensitive.

That is because those types of queries are not passed through the Analyzer, which is the component that performs operations such as stemming and lowercasing.

The reason for skipping the Analyzer is that if you were searching for "dogs*" you would not want "dogs" first stemmed to "dog", since that would then match "dog*", which is not the intended query.
A workaround for this is simply to lowercase the entire query before passing it to the query parser.

0 Comments  (click to add your comment)
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

About | Sitemap | Contact