CoreParserpublic class CoreParser extends Object implements QueryBuilderAssembles a QueryBuilder which uses only core Lucene Query objects |
Fields Summary |
---|
protected Analyzer | analyzer | protected QueryParser | parser | protected QueryBuilderFactory | queryFactory | protected FilterBuilderFactory | filterFactory |
Constructors Summary |
---|
public CoreParser(Analyzer analyzer, QueryParser parser)
this.analyzer=analyzer;
this.parser=parser;
filterFactory = new FilterBuilderFactory();
filterFactory.addBuilder("RangeFilter",new RangeFilterBuilder());
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));
queryFactory.addBuilder("ConstantScoreQuery",new ConstantScoreQueryBuilder(filterFactory));
SpanQueryBuilderFactory sqof=new SpanQueryBuilderFactory();
SpanNearBuilder snb=new SpanNearBuilder(sqof);
sqof.addBuilder("SpanNear",snb);
queryFactory.addBuilder("SpanNear",snb);
SpanTermBuilder snt=new SpanTermBuilder();
sqof.addBuilder("SpanTerm",snt);
queryFactory.addBuilder("SpanTerm",snt);
SpanOrBuilder sot=new SpanOrBuilder(sqof);
sqof.addBuilder("SpanOr",sot);
queryFactory.addBuilder("SpanOr",sot);
SpanOrTermsBuilder sots=new SpanOrTermsBuilder(analyzer);
sqof.addBuilder("SpanOrTerms",sots);
queryFactory.addBuilder("SpanOrTerms",sots);
SpanFirstBuilder sft=new SpanFirstBuilder(sqof);
sqof.addBuilder("SpanFirst",sft);
queryFactory.addBuilder("SpanFirst",sft);
SpanNotBuilder snot=new SpanNotBuilder(sqof);
sqof.addBuilder("SpanNot",snot);
queryFactory.addBuilder("SpanNot",snot);
|
|