使用solrj和EasyNet.Solr进行原子更新

2019-03-27 01:07|来源: 网路

《使用solrj和EasyNet.Solr进行原子更新》,作者:TerryLiang,原文链接:http://www.cnblogs.com/TerryLiang/archive/2012/12/08/2809352.html 分享自:博客园Android客户端(http://android.walkingp.com/cnblogs/)
转自:http://www.cnblogs.com/lexus/archive/2012/12/14/2817342

相关问答

更多
  • 使用Java 6,您可以使用Xpath从xml文件中获取所需的内容。 然后,从您从xml中提取的内容填充SolrInputDocument 。 当该文档包含您需要的所有内容时,请使用SolrServer的添加方法将其提交给Solr。 With Java 6, you can use Xpath to fetch what you need from your xml file. Then, you populate a SolrInputDocument from what you extracted fr ...
  • 在新版本中有一个SuggesterResponse: https://lucene.apache.org/solr/5_3_1/solr-solrj/org/apache/solr/client/solrj/response/SuggesterResponse.html In new versions have a SuggesterResponse: https://lucene.apache.org/solr/5_3_1/solr-solrj/org/apache/solr/client/solrj/r ...
  • ScriptTransformer的答案是肯定的,我通过试验和错误发现。 Solr文档显示了如何使用“set”,“add”或“inc”将更新属性添加到字段节点。 如果我使用必要的更新属性创建测试XML文件,那么传递到常规更新处理程序时它可以正常工作。 但是,当传递给DIH时 - 即使没有任何转换 - 更新属性也会被完全忽略。 以下是我用来重新引入update属性并获得原子更新工作的脚本转换器的简化版本。 请注意使用Java HashMap。 var atomicTransformer = function ...
  • 您必须在文档值中包含id部分,否则Solr无法找到要更新的原始文档。 这应该是uniqueKey字段。 document.addField("Id", 12345); 您无法在一个请求中对多个文档执行更新,因此每个文档都必须自行更新。 You have to include the id part in your document values, otherwise Solr isn't able to find the original document to update. This should ...
  • 你没有为每次迭代创建一个新的SolrDocument ,所以你只是为旧的添加值; 然后,循环的下一次迭代将导致为id字段设置两个值,这将不起作用。 为要添加的每个文档创建一个新的InputDocument,并在添加两个文档(无需为循环中的每个文档提交)后将提交移动到该位置。 我还会考虑将我的HashMap重写为表示要索引的单个对象,或者至少使用HashMap来描述具有“name”,“id”和“title”条目的对象,然后将这些hashmaps存储在一个列表。 for (int i = 0; i < 2; i ...
  • 您目前无法使用PySolr对Solr进行原子更新。 有一个拉动: https://github.com/toastdriven/pysolr/pull/99 但它尚未合并。 最后评论不到一个月前,如果你有兴趣我会评论它 - 或者如果你愿意的话,尝试自己合并代码。 You cannot currently make atomic updates to Solr using PySolr. There is a pull for it: https://github.com/toastdriven/pysolr ...
  • 已经为java7编译了Solr 4.9.0。 我发现为java6编译的最后一个版本是4.7.2。 您可以在项目的pom.xml中看到这一点(相关部分转载如下)。 maven-compiler-plugin 3.1 1.6 1.6 ...
  • 在服务器上执行查询之前,客户端不会知道你在服务器端设置了什么,对吧? 所以他们全都是空的并不奇怪。 要实现分页,您需要客户端的两个参数 - 页码和每页的项目数量。 一旦你得到了这两个,你可以在客户端构建你的SolrQuery,如下所示: SolrQuery query = new SolrQuery(searchTerm); query.setStart((pageNum - 1) * numItemsPerPage); query.setRows(numItemsPerPage); // execute ...
  • 尝试使用SolrQuery对象而不是ModifiableSolrParams。 也许它会有所帮助。 如果您因任何原因无法使用SolrQuery,请尝试使用静态名称,例如“CommonParams.Q”而不是像“?q”这样的硬编码名称。 EDITED 我测试了您的问题,我认为您的Application Server缺少配置。 你在使用JBoss 7.1吗? 您需要在.standalone.sh或standalone.bat中添加一行,告诉solr在哪里。 例如,在Jboss 7.1中,在默认配置中,您必须向s ...
  • 好吧,我在调试了一下SolrJ代码后解决了它。 你必须这样做: SolrInputDocument doc2 = new SolrInputDocument(); Map fpValue2 = new HashMap(); fpValue2.put("add","fp2"); doc2.setField("FACTURES_PRODUIT", fpValue2); Ok, I solved it ...