I am trying to find a document by the indexed value (PAR-17-252). I indexed the field using
Dim d As Lucene.Net.Store.Directory = FSDirectory.Open(New DirectoryInfo(p))
Dim a As Analyzer = New StandardAnalyzer(Lucene.Net.Util.Version.LUCENE_30)
Dim indexWriter As IndexWriter = New IndexWriter(d, a, True, indexWriter.MaxFieldLength.UNLIMITED)
doc.Add(New Field("GrantID", dr("GrantID").ToString(), Field.Store.YES, Field.Index.NOT_ANALYZED))
And I search with
term = term.Replace("-", " ")
term = term.Replace("/", " ")
Dim phases As String() = Nothing
phases = Split(term, ",")
For Each phase As String In phases
q.Add(parser.Parse(phase), Occur.SHOULD)
Next
Now I know that the "-" causes a problem but I don't know how to handle it. If I don't take it out of the search term I get back nothing if I leave it in I get back nothing. The PAR-17-252 is a record name index. If I take it out and try to search for the phrase "PAR 17 252" I still get nothing.
Any help is appreciated. I've read just about everything here about Lucene.net and still having some trouble.