For some reason, lucene does not return any results when it should be. Here is the search code
Dim util As New IndexerUtil() Dim dir As Lucene.Net.Store.Directory = FSDirectory.Open(New DirectoryInfo(util.getIndexDir())) Dim indexSearcher As New IndexSearcher(dir, False) Dim indexWriter As New IndexWriter(dir, New SimpleAnalyzer(), False, indexWriter.MaxFieldLength.UNLIMITED) Dim term As New Term("id", "346") Dim query As New TermQuery(term) Dim topDocs As TopDocs = indexSearcher.Search(query, 100)
There are no points (results) in topDocs. I know that there is a document in the index in which the id field is 346, but for some reason the search does not find it. This is how the id field is created.
doc.Add(New Field("id", ID, Field.Store.YES, Field.Index.ANALYZED))
I have other search fields and they work fine (for example, if I search in the subject field, I get the results that I have to)
source share