Lucene インデックス文字列フィールドから単語を検索するには?
フィールドTITLEのlucene インデックスがあり、ドキュメントのタイトルが含まれています
例:テレビが機能しない、モバイルが機能しない
タイトルから特定の単語を検索したい。
以下のコードは、FULL_CONTENET を TITLE に変更すると、結果が得られません。
Query qry = null;
qry = new QueryParser(FULL_CONTENT, new SimpleAnalyzer()).parse("not");
Searcher searcher = null;
searcher = new IndexSearcher(indexDirectory);
Hits hits = null;
hits = searcher.search(qry);
System.out.println(hits.length());