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 "G.Long" <jd...@gmail.com> on 2011/06/21 17:27:05 UTC
question about wildcards
Hi :)
I've got the following text indexed with simpleAnalyzer :
"security is a real problem."
If I try to search for secu*, it will find the document. But if I try to
search for curi*, there are no results.
I raed that it's not possible to add a * wildcard at the begining of the
query so what should I do to handle this type of query where the user
write just a part of the word (which is in the middle of the word) ?
Thank you :)
---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org
Re: question about wildcards
Posted by "G.Long" <jd...@gmail.com>.
Thank you for your advices :)
I'll try this.
Regards,
Gary
Le 21/06/2011 22:28, Danny Lade a écrit :
> IMO, a "reversed word Index" does not work in this case, because he's looking for a word in the middle (See curi*).
>
> Another idea is to build word chunks and save them in a second index plus docID of the first index.
>
> e.g. security go to "security ecurity curity ... ity"
>
> This is much faster to search (just "curi*") but getting much bigger in index size. So it depends what is needed ...
>
> Greetings Danny
>
>
>
> Am 21.06.2011 um 19:43 schrieb "Hiller, Dean x66079"<de...@broadridge.com>:
>
>> I wonder if you would be better off creating a second index with the words reversed.....depends on your application profile I guess and what you want, but an additional index may not be too bad in some cases to speed up the search.
>>
>> Dean
>>
---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org
Re: question about wildcards
Posted by Danny Lade <da...@googlemail.com>.
IMO, a "reversed word Index" does not work in this case, because he's looking for a word in the middle (See curi*).
Another idea is to build word chunks and save them in a second index plus docID of the first index.
e.g. security go to "security ecurity curity ... ity"
This is much faster to search (just "curi*") but getting much bigger in index size. So it depends what is needed ...
Greetings Danny
Am 21.06.2011 um 19:43 schrieb "Hiller, Dean x66079" <de...@broadridge.com>:
> I wonder if you would be better off creating a second index with the words reversed.....depends on your application profile I guess and what you want, but an additional index may not be too bad in some cases to speed up the search.
>
> Dean
>
> -----Original Message-----
> From: G.Long [mailto:jdevgl@gmail.com]
> Sent: Tuesday, June 21, 2011 9:43 AM
> To: java-user@lucene.apache.org
> Subject: Re: question about wildcards
>
> Thank you for the tip :)
>
> I'll try it.
>
> Regards,
> Gary
>
> Le 21/06/2011 17:38, Ian Lea a écrit :
>> See the javadocs for QueryParser.setAllowLeadingWildcard(boolean
>> allowLeadingWildcard). And from the FAQ, see
>> http://wiki.apache.org/lucene-java/LuceneFAQ#What_wildcard_search_support_is_available_from_Lucene.3F
>>
>> Be sure to heed the warnings about performance.
>>
>>
>> --
>> Ian.
>>
>> On Tue, Jun 21, 2011 at 4:27 PM, G.Long<jd...@gmail.com> wrote:
>>> Hi :)
>>>
>>> I've got the following text indexed with simpleAnalyzer :
>>>
>>> "security is a real problem."
>>>
>>> If I try to search for secu*, it will find the document. But if I try to
>>> search for curi*, there are no results.
>>>
>>> I raed that it's not possible to add a * wildcard at the begining of the
>>> query so what should I do to handle this type of query where the user write
>>> just a part of the word (which is in the middle of the word) ?
>>>
>>> Thank you :)
>>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
> This message and any attachments are intended only for the use of the addressee and
> may contain information that is privileged and confidential. If the reader of the
> message is not the intended recipient or an authorized representative of the
> intended recipient, you are hereby notified that any dissemination of this
> communication is strictly prohibited. If you have received this communication in
> error, please notify us immediately by e-mail and delete the message and any
> attachments from your system.
>
>
> ---------------------------------------------------------------------
> 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
RE: question about wildcards
Posted by "Hiller, Dean x66079" <de...@broadridge.com>.
I wonder if you would be better off creating a second index with the words reversed.....depends on your application profile I guess and what you want, but an additional index may not be too bad in some cases to speed up the search.
Dean
-----Original Message-----
From: G.Long [mailto:jdevgl@gmail.com]
Sent: Tuesday, June 21, 2011 9:43 AM
To: java-user@lucene.apache.org
Subject: Re: question about wildcards
Thank you for the tip :)
I'll try it.
Regards,
Gary
Le 21/06/2011 17:38, Ian Lea a écrit :
> See the javadocs for QueryParser.setAllowLeadingWildcard(boolean
> allowLeadingWildcard). And from the FAQ, see
> http://wiki.apache.org/lucene-java/LuceneFAQ#What_wildcard_search_support_is_available_from_Lucene.3F
>
> Be sure to heed the warnings about performance.
>
>
> --
> Ian.
>
> On Tue, Jun 21, 2011 at 4:27 PM, G.Long<jd...@gmail.com> wrote:
>> Hi :)
>>
>> I've got the following text indexed with simpleAnalyzer :
>>
>> "security is a real problem."
>>
>> If I try to search for secu*, it will find the document. But if I try to
>> search for curi*, there are no results.
>>
>> I raed that it's not possible to add a * wildcard at the begining of the
>> query so what should I do to handle this type of query where the user write
>> just a part of the word (which is in the middle of the word) ?
>>
>> Thank you :)
>>
---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org
This message and any attachments are intended only for the use of the addressee and
may contain information that is privileged and confidential. If the reader of the
message is not the intended recipient or an authorized representative of the
intended recipient, you are hereby notified that any dissemination of this
communication is strictly prohibited. If you have received this communication in
error, please notify us immediately by e-mail and delete the message and any
attachments from your system.
---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org
Re: question about wildcards
Posted by "G.Long" <jd...@gmail.com>.
Thank you for the tip :)
I'll try it.
Regards,
Gary
Le 21/06/2011 17:38, Ian Lea a écrit :
> See the javadocs for QueryParser.setAllowLeadingWildcard(boolean
> allowLeadingWildcard). And from the FAQ, see
> http://wiki.apache.org/lucene-java/LuceneFAQ#What_wildcard_search_support_is_available_from_Lucene.3F
>
> Be sure to heed the warnings about performance.
>
>
> --
> Ian.
>
> On Tue, Jun 21, 2011 at 4:27 PM, G.Long<jd...@gmail.com> wrote:
>> Hi :)
>>
>> I've got the following text indexed with simpleAnalyzer :
>>
>> "security is a real problem."
>>
>> If I try to search for secu*, it will find the document. But if I try to
>> search for curi*, there are no results.
>>
>> I raed that it's not possible to add a * wildcard at the begining of the
>> query so what should I do to handle this type of query where the user write
>> just a part of the word (which is in the middle of the word) ?
>>
>> Thank you :)
>>
---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org
Re: question about wildcards
Posted by Ian Lea <ia...@gmail.com>.
See the javadocs for QueryParser.setAllowLeadingWildcard(boolean
allowLeadingWildcard). And from the FAQ, see
http://wiki.apache.org/lucene-java/LuceneFAQ#What_wildcard_search_support_is_available_from_Lucene.3F
Be sure to heed the warnings about performance.
--
Ian.
On Tue, Jun 21, 2011 at 4:27 PM, G.Long <jd...@gmail.com> wrote:
> Hi :)
>
> I've got the following text indexed with simpleAnalyzer :
>
> "security is a real problem."
>
> If I try to search for secu*, it will find the document. But if I try to
> search for curi*, there are no results.
>
> I raed that it's not possible to add a * wildcard at the begining of the
> query so what should I do to handle this type of query where the user write
> just a part of the word (which is in the middle of the word) ?
>
> Thank you :)
>
> ---------------------------------------------------------------------
> 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