You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by Ben Jiang <be...@gmail.com> on 2009/12/28 07:42:00 UTC

SpanScorer example with lucene 3.0.0

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

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

Posted by Shashi Kant <sk...@sloan.mit.edu>.
You can enable that by

QueryParser.setAllowLeadingWildcard( true )


On Mon, Dec 28, 2009 at 2:46 AM, liujb <li...@ufida.com.cn> 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


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

Posted by Chris Hostetter <ho...@fucit.org>.
: References: <4B...@gmail.com>
:     <00...@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


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

Posted by Anshum <an...@gmail.com>.
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 <li...@ufida.com.cn> 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.
>

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

Posted by liujb <li...@ufida.com.cn>.
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.

Re: SpanScorer example with lucene 3.0.0

Posted by liujb <li...@ufida.com.cn>.
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