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 liujb <li...@ufida.com.cn> on 2009/12/28 08:46:11 UTC

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

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: 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.
>