The first question for this is always "what analyzers do you use at index
AND
query time?".

I'd do two things immediately. First, what does query.toString() show you
the query parses
to? StandardAnalyzer does some "interesting" things with periods. Also, you
have a hyphen
(-) in your query which is an operator.... You may be getting a query very
different than you expect.

Second, if you haven't already gotten a copy of Luke, please do so. It'll
both allow
you to investigate your index to see what's *actually* in there and see what
various queries turn into when fed through various analyzers.....

Best
Erick

On Wed, Nov 25, 2009 at 12:57 PM, Karl Heinz Marbaise <[email protected]>wrote:

> Hi,
>
> i'm just using Lucene 2.4 and have a problem with a "." within a field.
> This field contains a filename and obviously a filename can contain a "."
> (or multiple of them)...
>
> So if i do a search "+filename:testExcel-xaz.xls" this file will not be
> found...If i replace the "." with "?" it works...
>
> So my thought was to modify a CustomQueryParser (which i already use for
> ranges)...
>
> To scan the information I'm using this:
>
> Document doc....
>
> doc.add(new Field(fieldName.getValue(),  value, Field.Store.NO,
> Field.Index.NOT_ANALYZED));
>
>
> The question is: Is this the best solution or does exist a better one ?
>
>
> Many thanks in advance.
>
> Kind regards
> Karl Heinz Marbaise
> --
> SoftwareEntwicklung Beratung Schulung    Tel.: +49 (0) 2405 / 415 893
> Dipl.Ing.(FH) Karl Heinz Marbaise        ICQ#: 135949029
> Hauptstrasse 177                         USt.IdNr: DE191347579
> 52146 Würselen                           http://www.soebes.de
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>

Reply via email to