You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-commits@lucene.apache.org by Apache Wiki <wi...@apache.org> on 2010/05/22 12:34:27 UTC

[Lucene-java Wiki] Update of "LuceneFAQ" by JuanGarcia

Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Lucene-java Wiki" for change notification.

The "LuceneFAQ" page has been changed by JuanGarcia.
The comment on this change is: Lucene 1.9 was release long time ago.
http://wiki.apache.org/lucene-java/LuceneFAQ?action=diff&rev1=143&rev2=144

--------------------------------------------------

  
  ==== How can I search over multiple fields? ====
  
+ Searching over multiple fields is what people expect as Google searches all the fields by default. You have to parse the query using [[http://lucene.apache.org/java/2_9_1/api/all/org/apache/lucene/queryParser/MultiFieldQueryParser.html|MultiFieldQueryParser]]. Note that terms which occur in short fields have a higher effect on the result ranking.
- Parse your query using [[http://lucene.apache.org/java/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 all terms to appear in ''all'' fields. This is not what one typically
- wants, for example in a search over "title" and "body" fields (Lucene 1.9 fixes this problem).
  
  Alternatively you could create a field which concatenates the content you would like to search and
  search only that field.