SolrJ used to control Solr/Luce vs. Straight Rest Calls

给你一囗甜甜゛ 提交于 2019-12-24 14:04:09

问题


We are running a TomCat servlet (Railo) for a public facing REST application. I've started implementing SolrJ to control a standalone Solr cluster. Queries are working well, but I'm scratching my head over the flow vs. just using the straight HTTP interface Solr provides. I thought there was some performance benefit to using SolrJ which is why I started implementing it, but from what I'm reading and seeing in response times, I think I was wrong on that account (?).

Is there any real advantage to using SolrJ vs. just manipulating and returning the JSON response from Solr? I certainly get using SolrJ for a java application that is not returning JSON/XML to the client.


回答1:


I'm not aware of any claims of improved performance with SolrJ. It's designed, mostly, to be an easy-to-use way to interface with Solr. SolrJ might prevent you getting away with some things the Solr interface allows that would perform very poorly, but for simple searches on the index, I don't see it generating a signficant speed improvement.

One performance benefit from SolrJ that I do see: ConcurrentUpdateSolrServer looks like a performant way to handle updates, particularly with large batches of updates. I would expect it to perform much better, especially with heavy loads, than the naive implementation of just establishing a connection and sending updates one at a time.



来源:https://stackoverflow.com/questions/14261219/solrj-used-to-control-solr-luce-vs-straight-rest-calls

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!