## org.apache.lucene.xmlparser
Class CoreParser

    java.lang.Object
      org.apache.lucene.xmlparser.CoreParser

All Implemented Interfaces:
  QueryBuilder

Direct Known Subclasses:
  CorePlusExtensionsParser

    public class CoreParser

extends Object
implements QueryBuilder

Assembles a QueryBuilder which uses only core Lucene Query objects

Field Summary
`protected org.apache.lucene.analysis.Analyzer` `analyzer`
`protected FilterBuilderFactory` `filterFactory`
`static int` `maxNumCachedFilters`
`protected org.apache.lucene.queryParser.QueryParser` `parser`
`protected QueryBuilderFactory` `queryFactory`

Constructor Summary
`` `CoreParser(org.apache.lucene.analysis.Analyzer analyzer, org.apache.lucene.queryParser.QueryParser parser)` Construct an XML parser that uses a single instance QueryParser for handling UserQuery tags - all parse operations are synchronised on this parser
`` `CoreParser(String defaultField, org.apache.lucene.analysis.Analyzer analyzer)` Constructs an XML parser that creates a QueryParser for each UserQuery request.
`protected` `CoreParser(String defaultField, org.apache.lucene.analysis.Analyzer analyzer, org.apache.lucene.queryParser.QueryParser parser)`

Method Summary
`void` `addFilterBuilder(String nodeName, FilterBuilder builder)`
`void` `addQueryBuilder(String nodeName, QueryBuilder builder)`
`org.apache.lucene.search.Query` `getQuery(Element e)`
`org.apache.lucene.search.Query` `parse(InputStream xmlStream)`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### analyzer

    protected org.apache.lucene.analysis.Analyzer analyzer

### parser

    protected org.apache.lucene.queryParser.QueryParser parser

### queryFactory

    protected QueryBuilderFactory queryFactory

### filterFactory

    protected FilterBuilderFactory filterFactory

### maxNumCachedFilters

    public static int maxNumCachedFilters

Constructor Detail

### CoreParser

    public CoreParser(org.apache.lucene.analysis.Analyzer analyzer,
                      org.apache.lucene.queryParser.QueryParser parser)

  Construct an XML parser that uses a single instance QueryParser for handling UserQuery tags - all parse operations are synchronised on this parser

  Parameters:
    `analyzer` -
    `parser` - A QueryParser which will be synchronized on during parse calls.

### CoreParser

    public CoreParser(String defaultField,
                      org.apache.lucene.analysis.Analyzer analyzer)

  Constructs an XML parser that creates a QueryParser for each UserQuery request.

  Parameters:
    `defaultField` - The default field name used by QueryParsers constructed for UserQuery tags
    `analyzer` -

### CoreParser

    protected CoreParser(String defaultField,
                         org.apache.lucene.analysis.Analyzer analyzer,
                         org.apache.lucene.queryParser.QueryParser parser)

Method Detail

### parse

    public org.apache.lucene.search.Query parse(InputStream xmlStream)
                                         throws ParserException

  Throws:
    `ParserException`

### addQueryBuilder

    public void addQueryBuilder(String nodeName,
                                QueryBuilder builder)

### addFilterBuilder

    public void addFilterBuilder(String nodeName,
                                 FilterBuilder builder)

### getQuery

    public org.apache.lucene.search.Query getQuery(Element e)
                                            throws ParserException

  Specified by:
    `getQuery` in interface `QueryBuilder`
  Throws:
    `ParserException`