Example usage for org.apache.lucene.queryparser.surround.parser QueryParser QueryParser

List of usage examples for org.apache.lucene.queryparser.surround.parser QueryParser QueryParser

Introduction

In this page you can find the example usage for org.apache.lucene.queryparser.surround.parser QueryParser QueryParser.

Prototype

public QueryParser() 

Source Link

Usage

From source file:lux.IndexTest.java

License:Mozilla Public License

private void assertPathQuery(IndexTestSupport indexTestSupport) throws ParseException, IOException {
    SrndQuery q = new QueryParser().parse2("w(w({},\"ACT\"),\"SCENE\")");
    Query q2 = q.makeLuceneQueryFieldNoBoost(
            indexTestSupport.indexer.getConfiguration().getFieldName(FieldRole.PATH), new BasicQueryFactory());
    DocIdSetIterator iter = indexTestSupport.searcher.search(q2);
    int count = 0;
    while (iter.nextDoc() != DocIdSetIterator.NO_MORE_DOCS) {
        ++count;//from  w  w w . ja v  a2  s  . c o  m
    }
    assertEquals(5, count);
}