setIndexOptions(IndexOptions.DOCS_AND_FREQS):不适用于参数

时间:2016-02-24 05:23:02

标签: java

public MyIndexWriter( String dataType ) throws IOException {
    if (dataType.equals("trectext")) {
        directory = FSDirectory.open(new File(Classes.Path.IndexTextDir));  
    } else {
        directory = FSDirectory.open(new File(Classes.Path.IndexWebDir)); 
    }
    IndexWriterConfig indexConfig=new IndexWriterConfig(null, new       WhitespaceAnalyzer(null));
    indexConfig.setMaxBufferedDocs(10000);
    ixwriter = new IndexWriter( directory, indexConfig);
    type = new FieldType();
    type.setIndexOptions(IndexOptions.DOCS_AND_FREQS);
    type.setStored(false);
    type.setStoreTermVectors(true);
}
  

线程中的异常" main" java.lang.Error:未解析的编译   问题:方法setIndexOptions(FieldInfo.IndexOptions)中   类型FieldType不适用于参数(IndexOptions)

那么我应该如何处理" type.setIndexOptions(IndexOptions.DOCS_AND_FREQS);"?

0 个答案:

没有答案