mirror of https://github.com/apache/lucene.git
Added support for MatchAllDocs
git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@388296 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
49de97e3b0
commit
fa0516f6ee
|
@ -11,6 +11,7 @@ import org.apache.lucene.search.Query;
|
|||
import org.apache.lucene.xmlparser.builders.BooleanQueryBuilder;
|
||||
import org.apache.lucene.xmlparser.builders.ConstantScoreQueryBuilder;
|
||||
import org.apache.lucene.xmlparser.builders.FilteredQueryBuilder;
|
||||
import org.apache.lucene.xmlparser.builders.MatchAllDocsQueryBuilder;
|
||||
import org.apache.lucene.xmlparser.builders.RangeFilterBuilder;
|
||||
import org.apache.lucene.xmlparser.builders.SpanFirstBuilder;
|
||||
import org.apache.lucene.xmlparser.builders.SpanNearBuilder;
|
||||
|
@ -47,6 +48,7 @@ public class CoreParser implements QueryBuilder
|
|||
|
||||
queryFactory = new QueryBuilderFactory();
|
||||
queryFactory.addBuilder("TermQuery",new TermQueryBuilder());
|
||||
queryFactory.addBuilder("MatchAllDocsQuery",new MatchAllDocsQueryBuilder());
|
||||
queryFactory.addBuilder("BooleanQuery",new BooleanQueryBuilder(queryFactory));
|
||||
queryFactory.addBuilder("UserQuery",new UserInputQueryBuilder(parser));
|
||||
queryFactory.addBuilder("FilteredQuery",new FilteredQueryBuilder(filterFactory,queryFactory));
|
||||
|
|
|
@ -0,0 +1,11 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<FilteredQuery>
|
||||
<Query>
|
||||
<MatchAllDocsQuery/>
|
||||
</Query>
|
||||
|
||||
<Filter>
|
||||
<RangeFilter fieldName="date" lowerTerm="19870409" upperTerm="19870412"/>
|
||||
</Filter>
|
||||
|
||||
</FilteredQuery>
|
|
@ -135,6 +135,11 @@ public class TestParser extends TestCase {
|
|||
Query q=parse("ConstantScoreQuery.xml");
|
||||
dumpResults("ConstantScoreQuery",q, 5);
|
||||
}
|
||||
public void testMatchAllDocsPlusFilterXML() throws ParserException, IOException
|
||||
{
|
||||
Query q=parse("MatchAllDocsQuery.xml");
|
||||
dumpResults("MatchAllDocsQuery with range filter", q, 5);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue