I am trying to search by a number of fields including an alphanumeric model id.

This is just the model id that comes from manufacturers. I've tried to use a StandardAnalyzer and a SnowballAnalyzer to index the data. Then I search with the associated analyzer using a MultiFieldQueryParser. Going through the debug into the attached Lucene source, I see that all a MultiFieldQueryParser does is make a bunch of queries and link them together with a Boolean query with SHOULD values. I see that it is getting the right field, "model", and has the right query in there, e.g. "XPHP", but it returns no results.

When I index it, I do the following:
modelField = new Field("model", (product.getModelNumber() == null) ? "" : product.getModelNumber(), Field.Store.NO, Field.Index.UN_TOKENIZED);
...
document.add(modelField);
...
indexWriter.addDocument(document);

So it shouldn't be messing with the model id retrieved from the database when it puts it in the index (UN_TOKENIZED).

The weird thing is that it finds those model ids that are only numeric (including punctuation, e.g. "40603-38"). But it cannot find the "XPHP" model id. On the command line SQL interface, I can do a select * from product where model = 'XPHP'; and it comes back with the single result.

Anyone have any idea as to why the numeric ones would come up and the alphanumeric ones would not find the right values in the index?

Thanks much,
Jeremy

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to