Search in sources :

Example 1 with MockBytesAnalyzer

use of org.apache.lucene.analysis.MockBytesAnalyzer in project lucene-solr by apache.

the class TestQueryParser method testByteTerms.

// LUCENE-4176
public void testByteTerms() throws Exception {
    String s = "เข";
    Analyzer analyzer = new MockBytesAnalyzer();
    QueryParser qp = new QueryParser(FIELD, analyzer);
    assertTrue(isAHit(qp.parse("[เข TO เข]"), s, analyzer));
    assertTrue(isAHit(qp.parse("เข~1"), s, analyzer));
    assertTrue(isAHit(qp.parse("เข*"), s, analyzer));
    assertTrue(isAHit(qp.parse("เ*"), s, analyzer));
    assertTrue(isAHit(qp.parse("เ??"), s, analyzer));
}
Also used : MockBytesAnalyzer(org.apache.lucene.analysis.MockBytesAnalyzer) MockBytesAnalyzer(org.apache.lucene.analysis.MockBytesAnalyzer) MockSynonymAnalyzer(org.apache.lucene.analysis.MockSynonymAnalyzer) Analyzer(org.apache.lucene.analysis.Analyzer) MockAnalyzer(org.apache.lucene.analysis.MockAnalyzer)

Aggregations

Analyzer (org.apache.lucene.analysis.Analyzer)1 MockAnalyzer (org.apache.lucene.analysis.MockAnalyzer)1 MockBytesAnalyzer (org.apache.lucene.analysis.MockBytesAnalyzer)1 MockSynonymAnalyzer (org.apache.lucene.analysis.MockSynonymAnalyzer)1