developarvin
developarvin

Reputation: 5087

Zend Search Lucene - How do you make your query case insensitive?

It seems to me that Zend Search Lucene is default to case sensitive search. Is there a way to change this so that all queries are case insensitive?

Upvotes: 2

Views: 1156

Answers (1)

Ben D
Ben D

Reputation: 14479

Zend Search Lucene should default to case-insensitive (from documentation):

You can assign your own text analyzer or choose it from the set of predefined analyzers: Zend_Search_Lucene_Analysis_Analyzer_Common_Text and Zend_Search_Lucene_Analysis_Analyzer_Common_Text_CaseInsensitive (default). Both of them interpret tokens as sequences of letters. Zend_Search_Lucene_Analysis_Analyzer_Common_Text_CaseInsensitive converts all tokens to lower case.

You might have

Zend_Search_Lucene_Analysis_Analyzer::setDefault(
    new Zend_Search_Lucene_Analysis_Analyzer_Common_Text()
);

Set somewhere, which is switching it to case sensitive. You can try to find and remove that, or switch analyzers.

Upvotes: 1

Related Questions