【问题标题】:Indexing in Apache SolrApache Solr 中的索引
【发布时间】:2014-05-11 04:56:40
【问题描述】:

我对 Apache Solr 搜索引擎非常陌生。我已经安装在我的 CENT OS VM 上并且需要为文档编制索引。通过 Apache Solr UI,我可以放置和索引文档,但是我可以通过任何 JAVA API 来做同样的事情吗?请帮助我...谢谢

【问题讨论】:

    标签: solr


    【解决方案1】:

    试试SolrJ。对于 Solr,这里有一些开始的链接。

    1. Apache Solr Reference Guide
    2. Solr Wiki
    3. Yonik's Getting Started With Solr

    【讨论】:

      【解决方案2】:

      使用 SolrJ

      HttpSolrServer solr = new HttpSolrServer("<host>:<port>");
      SolrQuery solrquery = new SolrQuery();
      solrquery.setQuery("test");
      solrquery.set("defType", "edismax");
      solrquery.setHighlight(true);
      QueryResponse queryResponse = solr.query(solrquery);
      SolrDocumentList documentList = queryResponse.getResults();
      

      希望这会有所帮助:)

      【讨论】:

        猜你喜欢
        • 2013-07-28
        • 1970-01-01
        • 1970-01-01
        • 2019-03-11
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2012-04-13
        • 1970-01-01
        相关资源
        最近更新 更多