0
在壓縮字段值後,我已經執行了該字段的存儲和索引 但是當我嘗試搜索該值時,我得到了命中但沒有值。我怎樣才能獲得價值呢?在lucene中搜索問題3.0.2
/*這是我的索引代碼*/
文獻absDoc =新的文檔(); valuesbyte = CompressionTools.compress(valueForCompress.getBytes());用於搜索*/
查詢的查詢= parser.parse(字符串searchstr)
absDoc.add(new Field("Abstract", valuesbyte, Field.Store.YES));
absDoc.add(new Field("Abstract", valueForCompress, Field.Store.NO,
Field.Index.ANALYZED, Field.TermVector.NO));
/*代碼; TopDocs hits = is.search(query,10);
System.out.println("Hits = " + hits.scoreDocs.length); // It's displaying all hits
Document doc = new Document();
for(int i=0;i<hits.scoreDocs.length;i++) {
ScoreDoc scoreDoc = hits.scoreDocs[i];
doc = is.doc(scoreDoc.doc);
System.out.println(doc.get(fieldName)); // Here i got null value
}