FAQ
Hello,

I am new to using Lucene Indexing Server and to query syntax as well. I
went through the documentation about using proximity searches between 2
words.

But I would like to use proximity searches between two phrases. How do I
construct the Query for Lucene to fetch the relevant documents.?

For Ex. The query is "Economic Meltdown in Asian Countries" and the two
phrases are "Economic Meltdown" and "Asian Countries". I would like to
use proximity search between the two phrases.

How can I construct the Lucene query for proximity search between two
phrases.

I appreciate your help on this.

Regards
Vasu

Search Discussions

  • Aaron Schon at Dec 28, 2008 at 9:03 pm
    Take a look at SpanQuery and SpanNearQuery.


    ----- Original Message ----
    From: Vasudevan Comandur <vcomandur@gmail.com>
    To: java-user@lucene.apache.org
    Sent: Sunday, December 28, 2008 3:20:47 PM
    Subject: Proximity Search between phrases

    Hello,

    I am new to using Lucene Indexing Server and to query syntax as well. I
    went through the documentation about using proximity searches between 2
    words.

    But I would like to use proximity searches between two phrases. How do I
    construct the Query for Lucene to fetch the relevant documents.?

    For Ex. The query is "Economic Meltdown in Asian Countries" and the two
    phrases are "Economic Meltdown" and "Asian Countries". I would like to
    use proximity search between the two phrases.

    How can I construct the Lucene query for proximity search between two
    phrases.

    I appreciate your help on this.

    Regards
    Vasu





    ---------------------------------------------------------------------
    To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
    For additional commands, e-mail: java-user-help@lucene.apache.org
  • Vasudevan Comandur at Dec 28, 2008 at 9:20 pm
    Hello,

    I am new to using Lucene Indexing Server and to query syntax as well. I
    went through the documentation about using proximity searches between 2
    words.

    But I would like to use proximity searches between two phrases. How do I
    construct the Query for Lucene to fetch the relevant documents.?

    For Ex. The query is "Economic Meltdown in Asian Countries" and the two
    phrases are "Economic Meltdown" and "Asian Countries". I would like to
    use proximity search between the two phrases.

    How can I construct the Lucene query for proximity search between two
    phrases.

    I appreciate your help on this.

    Regards
    Vasu
  • Cool The Breezer at Dec 29, 2008 at 8:57 am
    You could you phrase queries also like "Economic Meltdown" AND "Asian Countries". but these phrases may be too distant from one another to be relevant for your searching purposes.
    To get better result wrt position(distance between phrases), you can use SpanNearQuery.

    Let me know if you need more help.

    regards,
    RB


    --- On Sun, 12/28/08, Vasudevan Comandur wrote:
    From: Vasudevan Comandur <vcomandur@gmail.com>
    Subject: Proximity Search between phrases
    To: java-user@lucene.apache.org
    Date: Sunday, December 28, 2008, 4:19 PM
    Hello,

    I am new to using Lucene Indexing Server and to query
    syntax as well. I
    went through the documentation about using proximity
    searches between 2
    words.

    But I would like to use proximity searches between two
    phrases. How do I
    construct the Query for Lucene to fetch the relevant
    documents.?

    For Ex. The query is "Economic Meltdown in Asian
    Countries" and the two
    phrases are "Economic Meltdown" and "Asian
    Countries". I would like to
    use proximity search between the two phrases.

    How can I construct the Lucene query for proximity
    search between two
    phrases.

    I appreciate your help on this.

    Regards
    Vasu



    ---------------------------------------------------------------------
    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
postedDec 28, '08 at 8:35p
activeDec 29, '08 at 8:57a
posts4
users3
websitelucene.apache.org

People

Translate

site design / logo © 2022 Grokbase