solr を使用して MySql データベースのインデックスを作成し、自分の Web サイトでデータをより高速に検索できるようにしたいと考えています。コードに solr を実装する方法がわかりません。
1600 次
2 に答える
0
あなたの質問は広すぎます。ただし、有利なスタートを切るには、SolrのDataImportを参照してください。
于 2013-06-27T08:59:01.570 に答える
0
you many want to check for Solr Data Import Handler module which will help you index data from MySQL into Solr without writing any java code.
If you have downloaded Solr, You can check out the example solr-4.3.0/example/example-DIH
(Refer to the readme.txt) which will give you an idea of how the DIH is configured and the indexing can be done.
CommonsHttpSolrServer commonsHttpSolrServer = new CommonsHttpSolrServer("http://localhost:8983/solr");
QueryRequest request = new QueryRequest(params);
request.setPath("/dataimport");
ModifiableSolrParams params = new ModifiableSolrParams();
params.set("command", "full-import");
commonsHttpSolrServer.request(request);
NOTE - The request sent is asynchronous, so you would receive an immediate response and would need to check the status to know if it was complete.
于 2013-06-27T08:59:53.980 に答える