FAQ
Is there any difference between using QueryParser and
MultiFieldQueryParser when have single default search field ?

Depending on how many default search fields on an searching an index I
select which of the two QueryParsers to use, but does it mater if I just
use MultiFIeldQueryParser all the time

Paul

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org

Search Discussions

  • Ian Lea at Jul 31, 2009 at 1:37 pm
    I'd guess there wouldn't be any difference, but haven't tried it. Try
    it out and see what query.toString() says in each case.


    --
    Ian.


    On Fri, Jul 31, 2009 at 1:37 PM, Paul Taylorwrote:
    Is there any difference between using QueryParser and MultiFieldQueryParser
    when have single default search field ?

    Depending on how many default search fields on an searching an index I
    select which of the two QueryParsers to use, but does it mater if I just use
    MultiFIeldQueryParser all the time

    Paul

    ---------------------------------------------------------------------
    To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
    For additional commands, e-mail: java-user-help@lucene.apache.org
    ---------------------------------------------------------------------
    To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
    For additional commands, e-mail: java-user-help@lucene.apache.org
  • Simon Willnauer at Jul 31, 2009 at 2:12 pm
    This would not make much of a difference. I would guess that you have
    one additional "wrapping" boolean query if you use
    MultiFieldQueryParser. For query "foo AND bar" the MFQueryParser
    creates +(fname:foo) +(fname:bar) and QueryParser would create
    +fname:foo +fname:bar so in this case one level of BooleanQuery more
    than QueryParser.

    simon

    On Fri, Jul 31, 2009 at 3:19 PM, Ian Leawrote:
    I'd guess there wouldn't be any difference, but haven't tried it.  Try
    it out and see what query.toString() says in each case.


    --
    Ian.


    On Fri, Jul 31, 2009 at 1:37 PM, Paul Taylorwrote:
    Is there any difference between using QueryParser and MultiFieldQueryParser
    when have single default search field ?

    Depending on how many default search fields on an searching an index I
    select which of the two QueryParsers to use, but does it mater if I just use
    MultiFIeldQueryParser all the time

    Paul

    ---------------------------------------------------------------------
    To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
    For additional commands, e-mail: java-user-help@lucene.apache.org
    ---------------------------------------------------------------------
    To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
    For additional commands, e-mail: java-user-help@lucene.apache.org
    ---------------------------------------------------------------------
    To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
    For additional commands, e-mail: java-user-help@lucene.apache.org
  • Paul Taylor at Jul 31, 2009 at 3:08 pm

    Simon Willnauer wrote:
    This would not make much of a difference. I would guess that you have
    one additional "wrapping" boolean query if you use
    MultiFieldQueryParser. For query "foo AND bar" the MFQueryParser
    creates +(fname:foo) +(fname:bar) and QueryParser would create
    +fname:foo +fname:bar so in this case one level of BooleanQuery more
    than QueryParser.

    simon
    Thanks, so minor performance difference but the results returned would
    always be the same.

    ---------------------------------------------------------------------
    To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
    For additional commands, e-mail: java-user-help@lucene.apache.org
  • Prashant ullegaddi at Jul 31, 2009 at 2:14 pm
    In MultiFieldQueryParser, you can mention different fields of the document
    which can
    be searched for

    E.g. in contents of the document, if you index different fields such as URL,
    BOLD, ITALIC, you can search over all of them.
    Additionally, there is provision to boost a field over the other as well.

    ~
    Prashant
    On Fri, Jul 31, 2009 at 6:49 PM, Ian Lea wrote:

    I'd guess there wouldn't be any difference, but haven't tried it. Try
    it out and see what query.toString() says in each case.


    --
    Ian.


    On Fri, Jul 31, 2009 at 1:37 PM, Paul Taylorwrote:
    Is there any difference between using QueryParser and
    MultiFieldQueryParser
    when have single default search field ?

    Depending on how many default search fields on an searching an index I
    select which of the two QueryParsers to use, but does it mater if I just use
    MultiFIeldQueryParser all the time

    Paul

    ---------------------------------------------------------------------
    To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
    For additional commands, e-mail: java-user-help@lucene.apache.org
    ---------------------------------------------------------------------
    To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
    For additional commands, e-mail: java-user-help@lucene.apache.org

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupjava-user @
categorieslucene
postedJul 31, '09 at 12:37p
activeJul 31, '09 at 3:08p
posts5
users4
websitelucene.apache.org

People

Translate

site design / logo © 2022 Grokbase