英文:
Is there any way to use "import org.apache.lucene.document.Field.Index;" with Apache lucene 8.6.0
问题
以下是您要的翻译内容:
我想使用以下代码,但它显示一个错误“无法找到符号”在“Field.Index”上,并且我正在使用“Apache Lucene 8.6.0”。
private static void addDoc(IndexWriter w, String v) throws IOException{
Document doc = new Document();
doc.add(new Field("",v,Field.Store.YES,Field.Index));
w.addDocument(doc);
}
那么,有没有办法使用Field.Index或任何可以执行此功能的Lucene类(必须使用版本8.6.0)?
英文:
I want to use the following code but it's showing an error Cannot find the symbol on Field.Index and I am using Apache lucene 8.6.0
private static void addDoc(IndexWriter w, String v) throws IOException{
Document doc = new Document();
doc.add(new Field("",v,Field.Store.YES,Field.Index));
w.addDocument(doc);
}
So, Is there any way to use Field.Index or any lucene class that can perform this function (version 8.6.0 is mandatory)
专注分享java语言的经验与见解,让所有开发者获益!
评论