I am using the standardanalyzer and adding the field I want to search by with the following code
doc.Add(
new Field(
"BookId",
book.CatalogueBookNo.ToString(),
Field.Store.YES,
Field.Index.NOT_ANALYZED,
Field.TermVector.NO));
doc.Add(
new Field("Title",
strTitle,
Field.Store.YES,
Field.Index.ANALYZED,
Field.TermVector.NO));
doc.Add(
new Field("Author",
strAuthor,
Field.Store.YES,
Field.Index.ANALYZED,
Field.TermVector.NO));
doc.Add(
new Field("IssueId_fk",
book.IssueId_fk,
Field.Store.YES,
Field.Index.NOT_ANALYZED,
Field.TermVector.NO));
All fields are searchable except the IssueId_Fk field (which is not analyzed and is therefore intact) - this field contains string values in the format '11_12_4', '11_12_3' etc.
I have opened the the lucene index in notepad and can confirm that the values are delimited and complete with underscores but searching on the IssueId_Fk field returns nothing.
Anyone know how to get around this?
Cheers
Wing