エルシャドはこちらです。私はルセンに取り組んでいます。 今、私は単語を検索することができます。しかし、単語の一部を入力すると、結果を得ることができません。 あなたは何をすべきかをplsできますか?luceneを使って単語の一部を検索する方法は?
は、インデックスのために、私は以下のコードを使用しています、以下のコード検索のための
writer = new IndexWriter(directory, new StandardAnalyzer(), true);
writer.SetUseCompoundFile(true);
doc.Add(Field.UnStored("text", parseHtml(html)));
doc.Add(Field.Keyword("path", relativePath));
writer.AddDocument(doc);
を使用しています。
Query query = QueryParser.Parse(this.Query,"text",new StandardAnalyzer());
// create the result DataTable
this.Results.Columns.Add("title", typeof(string));
this.Results.Columns.Add("sample", typeof(string));
this.Results.Columns.Add("path", typeof(string));
// search
Hits hits = searcher.Search(query);
this.total = hits.Length();
こんにちはアダム、 お返事ありがとうございます。 ドキュメントリンクをありがとう。私はこれを試し、あなたに返信します。 –
ドキュメントのリンクが壊れています – irperez