Really dumb search problem

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Really dumb search problem

Chris Mannion-2
Hi All

I'm going to start this with an apology because, as you'll see below, I've
probably missed out something quite fundamental about how Lucene works.

However, I'll explain the problem, we have a system setup which indexes and
searches records about business properties.  One of the fields we index on
is the postcode (zip code).  When putting the records into the idex, the
postcode field is processed as follows -

inspectionDoc.add(new Field("postcode", postcode, Field.Store.YES,
Field.Index.UN_TOKENIZED));

When we search, we build a very simple query.  For example, if the user
enters M11 1LQ in the search box, then we'll build a query in the form of
"(postcode:(M11 1LQ) )"

However, the postcode search never returns any results.  Other fields we
search on, using more complex query strings seem to work well, but postcode
never finds anything.  I've tried outputting the contents of Documents found
by other searches to make sure the postcode values are going in correctly
and they're definitely being at least stored correctly if not indexed.

Has anyone got an ideas why such a simple search, which should pick up
several exact matches, doesn't pick up anything?  Any help, however
insultingly simple it might seem, will be gratefully received at this
point.  Thanks.

Chris Mannion
Reply | Threaded
Open this post in threaded view
|

Re: Really dumb search problem

Ulf Dittmer-2
Have you tried double-quoting the postcode instead of
using parentheses:

postcode:"M11 1LQ"

Ulf

--- Chris Mannion <[hidden email]>
wrote:

> "(postcode:(M11 1LQ) )"
>
> However, the postcode search never returns any results.


      ____________________________________________________________________________________
Be a better friend, newshound, and
know-it-all with Yahoo! Mobile.  Try it now.  http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Really dumb search problem

Mark Miller-3
In reply to this post by Chris Mannion-2
You can't tokenize the the search query if its on that field...using
maybe a per field analyzer and the keyword analyzer? Check em out if you
havn't.

On Fri, 2008-04-25 at 16:01 +0100, Chris Mannion wrote:

> Hi All
>
> I'm going to start this with an apology because, as you'll see below, I've
> probably missed out something quite fundamental about how Lucene works.
>
> However, I'll explain the problem, we have a system setup which indexes and
> searches records about business properties.  One of the fields we index on
> is the postcode (zip code).  When putting the records into the idex, the
> postcode field is processed as follows -
>
> inspectionDoc.add(new Field("postcode", postcode, Field.Store.YES,
> Field.Index.UN_TOKENIZED));
>
> When we search, we build a very simple query.  For example, if the user
> enters M11 1LQ in the search box, then we'll build a query in the form of
> "(postcode:(M11 1LQ) )"
>
> However, the postcode search never returns any results.  Other fields we
> search on, using more complex query strings seem to work well, but postcode
> never finds anything.  I've tried outputting the contents of Documents found
> by other searches to make sure the postcode values are going in correctly
> and they're definitely being at least stored correctly if not indexed.
>
> Has anyone got an ideas why such a simple search, which should pick up
> several exact matches, doesn't pick up anything?  Any help, however
> insultingly simple it might seem, will be gratefully received at this
> point.  Thanks.
>
> Chris Mannion


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]