FAQ
Hi, there,

first of all, thanks for the awesome work!

We have migrated to lucene 3.0. We are very tempted to use SpanQuery, as
it seems to favor document ranking based on proximity (eg, within a
document, the distance of the matches is important to the document
ranking, or even the most important factor). I have tried with Surround
query parser to create SpanQuery. It did give the right document matches.

My problem is with the highlighter package. If I used the default
QueryScorer does not give any hits with the query, even though there
were matching documents.

I did ton of searches and it seemed that the highlighter package should
have worked with SpanQuery before (2.4.0).

My questions:

* is QueryScorer the right scorer? Should I use SpanScorer?
* If SpanScorer is the right class, there is no example about how to
use SpanScorer. Can someone point an example?

This seems to be quite some changes since 2.9.0. The old SpanScorer from
highlighter package has been moved to the lucene core. I would
appreciate if someone can help out here.


Thanks in advance

Ben

Search Discussions

  • Liujb at Dec 28, 2009 at 7:36 am
    oh,my god,

    Query Parser Syntax

    CANNOT use a * or ? symbol as the first character of a search.

    that's mean I can't wrinte a search string like '*test'. this will be cause a great restriction to use lucence.
    but ,that's a really a important search scene.

    can you give me some advice on this problem.

    tks.


    -----------------------------
    owind
  • Liujb at Dec 28, 2009 at 7:47 am
    oh,my god,

    Query Parser Syntax

    CANNOT use a * or ? symbol as the first character of a search.

    that's mean I can't wrinte a search string like '*test'. this will be cause a great restriction to use lucence.
    but ,that's a really a important search scene.

    can you give me some advice on this problem.

    tks.


    owind.
  • Shashi Kant at Dec 28, 2009 at 8:49 am
    You can enable that by

    QueryParser.setAllowLeadingWildcard( true )

    On Mon, Dec 28, 2009 at 2:46 AM, liujb wrote:

    oh,my god,

    Query Parser Syntax

    CANNOT use a * or ? symbol as the first character of a search.

    that's mean I can't wrinte a search string like '*test'. this will be cause a great restriction to use lucence.
    but ,that's a really a important search scene.

    can you give me some advice on this problem.

    tks.


    owind.
    ---------------------------------------------------------------------
    To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
    For additional commands, e-mail: java-user-help@lucene.apache.org
  • Anshum at Dec 28, 2009 at 9:03 am
    Hi,
    Don't worry! there always are ways!
    Is prefix query is what you are trying to run? They would run but would be
    highly unoptimized as lucene stores terms in a lexically sorted manner in
    its index. <term>* like query terms are allowed by the parser/searcher
    though.
    Possible solution for this would be:
    Index flipped terms (using an appropriate analyzer) i.e. cat is also indexed
    as tac. You may then query on ta* instead of at*.
    Does that solve your issues/concern?

    --
    Anshum Gupta
    Naukri Labs!
    http://ai-cafe.blogspot.com

    The facts expressed here belong to everybody, the opinions to me. The
    distinction is yours to draw............

    On Mon, Dec 28, 2009 at 1:16 PM, liujb wrote:

    oh,my god,

    Query Parser Syntax

    CANNOT use a * or ? symbol as the first character of a search.

    that's mean I can't wrinte a search string like '*test'. this will be cause
    a great restriction to use lucence.
    but ,that's a really a important search scene.

    can you give me some advice on this problem.

    tks.


    owind.
  • Chris Hostetter at Dec 29, 2009 at 8:27 pm
    : References: <4B385338.9000707@gmail.com>
    : <00e801ca8790$4ca2ab90$1b4f010a@ufsoft.com.cn>
    : Subject: CANNOT use a * or ? symbol as the first character of a search.

    http://people.apache.org/~hossman/#threadhijack
    Thread Hijacking on Mailing Lists

    When starting a new discussion on a mailing list, please do not reply to
    an existing message, instead start a fresh email. Even if you change the
    subject line of your email, other mail headers still track which thread
    you replied to and your question is "hidden" in that thread and gets less
    attention. It makes following discussions in the mailing list archives
    particularly difficult.
    See Also: http://en.wikipedia.org/wiki/User:DonDiego/Thread_hijacking




    -Hoss


    ---------------------------------------------------------------------
    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, '09 at 6:42a
activeDec 29, '09 at 8:27p
posts6
users5
websitelucene.apache.org

People

Translate

site design / logo © 2022 Grokbase