[英]No accessible 'New' accepts this number of arguments
Sub CreatePersonsIndex(ByVal dt As System.Data.DataTable)
Try
'Specify the index file location where the indexes are to be stored
Dim indexFileLocation As String = "C:\Users\Shahrukh\Documents\visual studio 2012\Projects\WpfApplication33\WpfApplication33\App_Data"
Dim dir As Lucene.Net.Store.Directory = Lucene.Net.Store.FSDirectory.GetDirectory(indexFileLocation, True)
Dim indexWriter As New IndexWriter(dir, New StandardAnalyzer(), True)
indexWriter.SetRAMBufferSizeMB(10.0)
indexWriter.SetUseCompoundFile(False)
indexWriter.SetMaxMergeDocs(10000)
indexWriter.SetMergeFactor(100)
If dt IsNot Nothing Then
If dt.Rows.Count > 0 Then
For Each dr As System.Data.DataRow In dt.Rows
'Create the Document object
Dim doc As New Document()
For Each dc As System.Data.DataColumn In dt.Columns
'Populate the document with the column name and value from our query
doc.Add(New Field(dc.ColumnName, dr(dc.ColumnName).ToString(), Field.Store.YES, Field.Index.TOKENIZED))
Next
' Write the Document to the catalog
indexWriter.AddDocument(doc)
Next
End If
End If
' Close the writer
indexWriter.Close()
Catch ex As Exception
MsgBox("Error")
End Try
End Sub
using this code got an error 使用此代码出现错误
" No accessible 'New' accepts this number of arguments." “没有可访问的'New'接受此数目的参数。”
help me to solve this 帮我解决这个问题
这可能对您有用: 类
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.