“import org.apache.lucene.document.Field.Index;” 是否能在 Apache Lucene 8.6.0 中使用?

huangapple 未分类评论76阅读模式
英文:

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)

huangapple
  • 本文由 发表于 2020年8月14日 23:21:04
  • 转载请务必保留本文链接:https://java.coder-hub.com/63415590.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定