KattaでFieldCacheを使用するには、FieldCacheはIndexReaderを引数として、次にKatta APIからIndexReaderを取得する方法を想定しています。そして、kattaではLuceneClient.javaの検索メソッドがHitsを返します。 これから私はListから各ヒットのdocIdを得ることができますが、私はKattaのdocIdの特定のフィールド値が必要です。コーディング例を教えてください。Katta docId to Document
0
A
答えて
0
私は刈田で働いたことがありません、私はSolrので働いていたと私はそのidで文書を取得しなければならなかったと私は唯一のLuceneクラスを使用していた場合、私はorg.apache.lucene.search.IndexSearcher
を使用したい:
// when you figure out how to get IndexReader using Katta API, you'll be able to get the searcher
IndexSearcher searcher = new IndexSearcher(indexReader);
org.apache.lucene.document.Document doc = searcher.doc(docId);
String yourFieldValue = doc.get("yourFieldName");
0
することができますIndexReaderがサーバー側にあるため、クライアント側でFieldCacheを使用しないでください! しかし、LuceneClientのgetDetails()メソッドでフィールド値を取得できます。
final Hits hits = client.search(query, new String[] { INDEX_NAME }, 10);
for (final Hit hit : hits.getHits()) {
final MapWritable details = client.getDetails(hit, new String[] { "path" });
details.get(new Text("path"));
HTH ヨハネス
関連する問題
- 1. Katta in production environment
- 2. Katta Indexのユーザインタフェース
- 3. Lucene 3.0.3から信頼できるdocidを取得するには?
- 4. encode issue python word document
- 5. jQuery(document).ready()load()aspx
- 6. Morphia update recursive document
- 7. Rails embed document
- 8. liveCycle force close document
- 9. StyledEditorKit - Document - NotSerializableException
- 10. jQuery(document).ready(function($)
- 11. Python refresh HTML document
- 12. jquery document width
- 13. Observable xml document
- 14. JQuery:Rebind $(document).Ready()
- 15. $(document).ready in javascript
- 16. $(document).height()odd behavior
- 17. validate sitemap document
- 18. LINQ to SQLとLINQ to DataSet
- 19. JQuery $(document).ready()とdocument.write()
- 20. Sharepoint as Document Management Solution
- 21. jQuery .live()とDocument ready
- 22. jQueryモバイルリンクリストpageInit()、$(document).ready()
- 23. $(document)と$(location)で呼ばれる "document"と "location"は何ですか?
- 24. JavaScript:DOMロードイベント、実行シーケンス、$(document).ready()
- 25. 複数の$(document).ready関数
- 26. <script defer>と$(document).ready
- 27. Django Admin Image/Document Uploader/Manager
- 28. $(document).ready()内のjqueryスコープ?
- 29. Documentクラスのモデリング方法
- 30. "$(document).ready"の代替機能
おかげで、あなたはmbonaciに答えるために、実際に私の質問自体に私は、思った私は – Nageswaran
...それを見つけることができないことはでき言及したようにこれを言って:_IできることそれぞれのヒットのdocIdを取得するが、docIdの特定のフィールド値が必要な場合は、docIdを持っていればフィールド値を取得する方法を知らなかった。ところで、私は失礼ではありませんが、_can_と_able_を間違った方法で使用していることに気付きました。あなたは、何かをすることができないか、何かをすることはできないとあなたは言う。それらの2つはうまくいっていない:) –
カッタはLucandraに似ていませんか?私はKattaでも何らかのディレクトリ抽象化がなければならないということです。 –