Click here to Skip to main content
15,887,027 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i am using a below code for it but its give an error on prepared index
C#
Dim directory As Directory = FSDirectory.GetDirectory(folderName)
           Dim analyzer As Lucene.Net.Analysis.Analyzer = New SimpleAnalyzer()
           Dim indexWriter As New IndexWriter(directory, analyzer)
           indexWriter.SetRAMBufferSizeMB(10.0)
           indexWriter.SetUseCompoundFile(False)
           indexWriter.SetMaxMergeDocs(10000)
           indexWriter.SetMergeFactor(100)

           For Each value As IList In preparedtoindex
               Dim doc As New Document()
               For Each name As String In selectStatement
                   doc.Add(New Field(selectedName, value(cntr).ToString(), Field.Store.YES, Field.Index.ANALYZED))
               Next
               doc.Add(New Field("title", Field.Store.YES, Field.Index.ANALYZED, Field.TermVector.YES))
               writer.AddDocument(doc)
           Next
           indexWriter.Optimize()
           indexWriter.Close()
Posted
Comments
Herman<T>.Instance 22-Dec-15 3:36am    
What error?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900