## org.apache.lucene.xmlparser.builders
Class UserInputQueryBuilder

    java.lang.Object
      org.apache.lucene.xmlparser.builders.UserInputQueryBuilder

All Implemented Interfaces:
  QueryBuilder

    public class UserInputQueryBuilder

extends java.lang.Object
implements QueryBuilder

UserInputQueryBuilder uses 1 of 2 strategies for thread-safe parsing: 1) Synchronizing access to "parse" calls on a previously supplied QueryParser or.. 2) creating a new QueryParser object for each parse request

Constructor Summary
`UserInputQueryBuilder(org.apache.lucene.queryParser.QueryParser parser)` This constructor has the disadvantage of not being able to change choice of default field name
`UserInputQueryBuilder(java.lang.String defaultField, org.apache.lucene.analysis.Analyzer analyzer)`

Method Summary
`protected org.apache.lucene.queryParser.QueryParser` `createQueryParser(java.lang.String fieldName, org.apache.lucene.analysis.Analyzer analyzer)` Method to create a QueryParser - designed to be overridden
`org.apache.lucene.search.Query` `getQuery(org.w3c.dom.Element e)`

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

Constructor Detail

### UserInputQueryBuilder

    public UserInputQueryBuilder(org.apache.lucene.queryParser.QueryParser parser)

  This constructor has the disadvantage of not being able to change choice of default field name

  Parameters:
    `parser` - thread un-safe query parser

### UserInputQueryBuilder

    public UserInputQueryBuilder(java.lang.String defaultField,
                                 org.apache.lucene.analysis.Analyzer analyzer)

Method Detail

### getQuery

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

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

### createQueryParser

    protected org.apache.lucene.queryParser.QueryParser createQueryParser(java.lang.String fieldName,
                                                                          org.apache.lucene.analysis.Analyzer analyzer)

  Method to create a QueryParser - designed to be overridden

  Parameters:
    `fieldName` -
    `analyzer` -
  Returns:
    QueryParser

Copyright © 2000-2011 Apache Software Foundation. All Rights Reserved.