lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ozgur Yilmazel" <ozguryilma...@gmail.com>
Subject Re: QueryParser stripping special char
Date Tue, 12 Jun 2007 15:55:51 GMT
Hi Harini;

If you are already indexing phone numbers in a separate field, you
could also consider indexing the area code as a separate field too.
This might give better performance depending on the size of your
index.

Ozgur



On 6/12/07, Harini Raghavan <harini.raghavan@insideview.com> wrote:
> Hi All,
>
> I am trying to create a lucene query to search for companies based on
> areacode. The phone no. is stored in the lucene index in the form of
> '415-567-2323'. I need to create a query like +areaCode:"415-". But the
> QueryParser is stripping off the hyphen(-).
>
> Here is the code to create the query:
> Query query = QueryParser.parse("415-", "phone", analyzer);
>
> I tried by escaping the hyphen and even that did not work.
> Query query = QueryParser.parse ("415\\-", "phone", analyzer);
>
> Can anyone please suggest a way to do this?
>
> Thanks,
> Harini
>

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