Date: 2005-01-04T14:43:18 Editor: DanielNaber Wiki: Jakarta Lucene Wiki Page: LuceneFAQ URL: http://wiki.apache.org/jakarta-lucene/LuceneFAQ
no comment Change Log: ------------------------------------------------------------------------------ @@ -110,6 +110,17 @@ * Increase the number of terms using [http://jakarta.apache.org/lucene/docs/api/org/apache/lucene/search/BooleanQuery.html#setMaxClauseCount(int) BooleanQuery.setMaxClauseCount()]. Note that this will increase the memory requirements for searches that expand to many terms. To deactivate any limits, use !BooleanQuery.setMaxClauseCount(Integer.MAX_VALUE). +==== How can I search over multiple fields? ==== + +Parse your query using [http://jakarta.apache.org/lucene/docs/api/org/apache/lucene/queryParser/MultiFieldQueryParser.html MultiFieldQueryParser]. Note that terms which occur in short fields have a higher effect on +the result ranking. Also !MultiFieldQueryParser builds queries that sometimes behave unexpectedly, +namely for AND queries: it requires alls terms to appear in ''all'' field. This is not what one typically +wants, for example in a search over "title" and "body" fields (Lucene 2.0 fixes this problem). + +Alternatively you could create a field which concatenates the content you would like to search and +search only that field. + + ==== What wildcard search support is available from Lucene? ==== Lucene supports wild card queries which allow you to perform searches such as ''book*'', which will find documents containing terms such as ''book'', ''bookstore'', ''booklet'', etc. Lucene refers to this type of a query as a 'prefix query'. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]