Search in sources :

Example 21 with QueryParser

use of org.apache.lucene.queryParser.QueryParser in project jbosstools-hibernate by jbosstools.

the class FacadeFactoryImpl method createQueryParser.

@Override
public IQueryParser createQueryParser(String defaultField, IAnalyzer analyzer) {
    Analyzer luceneAnalyzer = (Analyzer) ((IFacade) analyzer).getTarget();
    QueryParser targetParser = new QueryParser(Version.LUCENE_34, defaultField, luceneAnalyzer);
    return new AbstractQueryParser(this, targetParser) {
    };
}
Also used : IQueryParser(org.jboss.tools.hibernate.search.runtime.spi.IQueryParser) QueryParser(org.apache.lucene.queryParser.QueryParser) AbstractQueryParser(org.jboss.tools.hibernate.search.runtime.common.AbstractQueryParser) AbstractQueryParser(org.jboss.tools.hibernate.search.runtime.common.AbstractQueryParser) Analyzer(org.apache.lucene.analysis.Analyzer) IAnalyzer(org.jboss.tools.hibernate.search.runtime.spi.IAnalyzer)

Aggregations

QueryParser (org.apache.lucene.queryParser.QueryParser)21 Query (org.apache.lucene.search.Query)12 ParseException (org.apache.lucene.queryParser.ParseException)8 StandardAnalyzer (org.apache.lucene.analysis.standard.StandardAnalyzer)7 IOException (java.io.IOException)6 Document (org.apache.lucene.document.Document)6 BooleanQuery (org.apache.lucene.search.BooleanQuery)6 TermQuery (org.apache.lucene.search.TermQuery)6 Analyzer (org.apache.lucene.analysis.Analyzer)4 IndexSearcher (org.apache.lucene.search.IndexSearcher)4 RAMDirectory (org.apache.lucene.store.RAMDirectory)4 Name (org.apache.jackrabbit.spi.Name)3 Field (org.apache.lucene.document.Field)3 IndexReader (org.apache.lucene.index.IndexReader)3 IndexWriter (org.apache.lucene.index.IndexWriter)3 Hits (org.apache.lucene.search.Hits)3 Test (org.junit.Test)3 Contact (com.zimbra.cs.mailbox.Contact)2 Mailbox (com.zimbra.cs.mailbox.Mailbox)2 ParsedContact (com.zimbra.cs.mime.ParsedContact)2