Perforce Chronicle 2012.2/486814
API Documentation

P4Cms_Search_Lucene_Analysis_Analyzer_Common_Utf8Num_CaseInsensitive Class Reference

Extends utf8 number query analyzer to be case-insensitive even if the mbstring extension is not installed (falls back to strtolower). More...

List of all members.

Public Member Functions

 __construct ()
 Add a lower-case token filter to the analyzer.

Detailed Description

Extends utf8 number query analyzer to be case-insensitive even if the mbstring extension is not installed (falls back to strtolower).

Copyright:
2011-2012 Perforce Software. All rights reserved
License:
Please see LICENSE.txt in top-level folder of this distribution.
Version:
2012.2/486814

Constructor & Destructor Documentation

P4Cms_Search_Lucene_Analysis_Analyzer_Common_Utf8Num_CaseInsensitive::__construct ( )

Add a lower-case token filter to the analyzer.

If the mbstring extension is present, use the UTF-8 aware strtolower, otherwise, use PHP's built-in strtolower - not ideal, but should be relatively harmless.

    {
        parent::__construct();

        if (extension_loaded("mbstring")) {
            $this->addFilter(new Zend_Search_Lucene_Analysis_TokenFilter_LowerCaseUtf8());
        } else {
            $this->addFilter(new Zend_Search_Lucene_Analysis_TokenFilter_LowerCase());
        }
    }

The documentation for this class was generated from the following file: