lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Simon Willnauer <simon.willna...@googlemail.com>
Subject Re: Searching for a special character
Date Wed, 24 Jun 2009 18:24:26 GMT
Beside choosing the right analyzer you could run into problems if you
use a query parser as it will interpret you parentesis.

simon

On Wed, Jun 24, 2009 at 8:11 PM, Erick Erickson<erickerickson@gmail.com> wrote:
> First, I highly, highly recommend you get a copy of Luke to examineyour
> index. It'll also help you understand the role of Analyzers.
>
> Your first problem is that StandardAnalyzer probably removes
> the open and close parens. See:
> http://lucene.apache.org/java/2_4_1/api/index.html
> so you can't search on them *even if* you escape the
> terms in your query parsing correctly, see:
> http://lucene.apache.org/java/2_3_2/queryparsersyntax.html#Escaping Special
> Characters
>
> You want to understand the implications of whatever
> analyzer you choose, or progress will be...er...difficult <G>.
>
> Luke will allow you to try different Analyzers and see the results of
> parsing
> queries, which will be a fine place to start...
>
> Best
> Erick
>
> On Wed, Jun 24, 2009 at 1:30 PM, Radha Sreedharan <radha84@gmail.com> wrote:
>
>> Hi all,
>>
>> I am using a Standard analyzer on both my search field and my query.
>> I use a  SpanNearQuery to search on the search field.
>> One of the query terms has  special characters like ( - round open bracket
>> and ) - round close bracket  : How does Lucene handle this?
>> Also, the search field has ( and  ) : How does Lucene handle this? Is it
>> treated as white space and ignored?
>>
>> Is it possible to search for special characters ? ie if my query has ) then
>> it should search for it and only if my search field has ) , it should give
>> me a hit.
>>
>> Regards,
>> Radha
>>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Mime
View raw message