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 Ulf Dittmer <ud...@yahoo.com> on 2008/05/16 11:02:07 UTC

search problem - not finding field values ending in "X"

Hello-

I'm experiencing a weird issue searching an index. The
index has information about books, and one of the
fields is the ISBN number. It is stored in the index
in untokenized form to enable searches by ISBN. So a
query like "isbn:0071490833" would return the Document
for that book. But it doesn't find the document if the
ISBN ends in an "X", like "isbn:007149216X".

I know it's stored correctly, because if I retrieve
the document through a different query, I see that the
field contains the correct value.

It also works fine if I search for "isbn:007149216?".

Is the "X" some kind of special syntax?

Many thanks in advance for any hints,
Ulf



      

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


Re: search problem - not finding field values ending in "X"

Posted by Ulf Dittmer <ud...@yahoo.com>.
D'oh!

Of course - I'm using StandardAnalyzer. Changing to a
PerFieldAnalyzerWrapper with a KeywordAnalyzer for
that field fixes the issue.

Thanks so much for fast response. 

Ulf


--- Ian Lea <ia...@gmail.com> wrote:

> Hi
> 
> 
> I bet you are using an analyzer that is downcasing
> isbn:007149216X to
> isbn:007149216x.  I've been there! Options include
> creating the query
> programmatically, using PerFieldAnalyzerWrapper,
> downcasing everything
> yourself in advance.  Or convert to ISBN-13.



      

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


Re: search problem - not finding field values ending in "X"

Posted by Ian Lea <ia...@gmail.com>.
Hi


I bet you are using an analyzer that is downcasing isbn:007149216X to
isbn:007149216x.  I've been there! Options include creating the query
programmatically, using PerFieldAnalyzerWrapper, downcasing everything
yourself in advance.  Or convert to ISBN-13.


--
Ian.


On Fri, May 16, 2008 at 10:02 AM, Ulf Dittmer <ud...@yahoo.com> wrote:
> Hello-
>
> I'm experiencing a weird issue searching an index. The
> index has information about books, and one of the
> fields is the ISBN number. It is stored in the index
> in untokenized form to enable searches by ISBN. So a
> query like "isbn:0071490833" would return the Document
> for that book. But it doesn't find the document if the
> ISBN ends in an "X", like "isbn:007149216X".
>
> I know it's stored correctly, because if I retrieve
> the document through a different query, I see that the
> field contains the correct value.
>
> It also works fine if I search for "isbn:007149216?".
>
> Is the "X" some kind of special syntax?
>
> Many thanks in advance for any hints,
> Ulf

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