solrj

How to use SpellingResult class in SolrJ

为君一笑 提交于 2019-12-10 17:13:37
问题 I'm using SolrJ. But through the API documentation could not figure out how to use the particular class to receive the response of the spell checker. i have a search component defined in solrconfig.xml for performing the checking 回答1: Maybe you already found the solution, anyway the SpellingResult class comes with Solr, while you're using SolrJ to access a Solr server, if I'm not wrong. So, you should use the specific classes that come with SolrJ; the QueryResponse object contains a

Solr performance with commitWithin does not make sense

五迷三道 提交于 2019-12-10 16:54:26
问题 I am running a very simple performance experiment where I post 2000 documents to my application. Who in tern persists them to a relational DB and sends them to Solr for indexing (Synchronously, in the same request). I am testing 3 use cases: No indexing at all - ~45 sec to post 2000 documents Indexing included - commit after each add. ~8 minutes (!) to post and index 2000 documents Indexing included - commitWithin 1ms ~55 seconds (!) to post and index 2000 documents The 3rd result does not

SolrJ and Auto Commit

♀尐吖头ヾ 提交于 2019-12-10 14:53:56
问题 I am adding documents to a Solr 4.3 core using SolrJ API , I noticed that I have the autocommit set to 15 seconds in the stock solrconfig that I am using as below. <autoCommit> <maxTime>${solr.autoCommit.maxTime:15000}</maxTime> <openSearcher>false</openSearcher> </autoCommit> My undestanding is that since the auto commit is set to true it means that the Solr instance would be auto commiting anyhow every 15 seconds, so I would not need to commit explicity using the SolrJ API as in below

How to access the admin interface of an EmbeddedSolrServer instance?

余生颓废 提交于 2019-12-10 14:27:16
问题 In my web app I am running an org.apache.solr.client.solrj.embedded.EmbeddedSolrServer for debugging purposes I would like to access the admin interface. This is how I instantiate the server: new EmbeddedSolrServer(new CoreContainer.Initializer().initialize(), ""); Is there a way to open the admin interface of this embedded server like so? http://localhost:<defaultport>/admin If so which port would I have to use (what is the default port)? Else is there a setting that I use to specify the web

Files locked after indexing

不羁的心 提交于 2019-12-10 13:15:50
问题 I have the following workflow in my (web)application: download a pdf file from an archive index the file delete the file My problem is that after indexing the file, it remains locked and the delete-part throws an exception. Here is my code-snippet for indexing the file: try { ContentStreamUpdateRequest req = new ContentStreamUpdateRequest("/update/extract"); req.addFile(file, type); req.setAction(AbstractUpdateRequest.ACTION.COMMIT, true, true); NamedList<Object> result = server.request(req);

Solr: Adding cores using a configSet in a SolrCloud setup does not work

混江龙づ霸主 提交于 2019-12-10 12:12:50
问题 I have a SolrCloud (v5.2) setup with 2 different cores [ users, docs ] working properly. Now I need to be able to dynamically add new cores that are configuration-wise identical to the docs core that already exists. I don't want to duplicate the configuration (I tried an it works OK) as I need to actually share the synonyms.txt and some other files that constantly change. I think that I need "configsets" but I cannot get them to work. I uploaded the "template" conf using this command: sh

Solr, how to use the new field update modes (atomic updates) with SolrJ

你说的曾经没有我的故事 提交于 2019-12-10 10:26:53
问题 Solr 4.x has this nice new feature that lets you specify how, when doing an update on an existing document, the multiValued fields will be updated. Specifically, you can say if the update document will replace the old values of a multivalued field with the new ones, or if it should append the new values to the existing ones. I've tried this using the request handler, as described here: http://wiki.apache.org/solr/UpdateXmlMessages#Optional_attributes_for_.22field.22 I've used curl to send xml

How to connect embedded solr with each other by sharding

丶灬走出姿态 提交于 2019-12-10 10:23:18
问题 I have been using sharding with multiple basic solr server for clustering. I also used one embedded solr server (Solrj Java API) with many basic solr servers and connecting them by sharding as embedded solr server is the caller of them. I used the code line below for this purpose. SolrQuery query = new SolrQuery(); query.set("shards", "solr1URL,solr2URL,..."); Now, I have many embedded solr servers running on different computers and they are unaware of each others. I want to communicate them

Deleting index from Solr using solrj as a client

℡╲_俬逩灬. 提交于 2019-12-09 16:12:18
问题 I am using solrj as client for indexing documents on the solr server. I am having problem while deleting the indexes by 'id' from the solr server. I am using following code to delete the indexes: server.deleteById("id:20"); server.commit(true,true); After this when i again search for the documents, the search result contains the above document also. Dont know what is going wrong with this code. Please help me out with issue. Thanks! 回答1: When you call deleteById, just use the id, without

Solrj Authentication Fails On Write Operation

一个人想着一个人 提交于 2019-12-09 03:48:41
问题 Just password protected solr on Jetty server. I am able to read/access data from solr using solrj :-> HttpSolrServer solr = new HttpSolrServer("http://111.111.111:8983/solr/mysolr"); HttpClientUtil.setBasicAuth((DefaultHttpClient) solr.getHttpClient(), "admin", "akshaybhatt"); but it gives me I/O Exception as below. There are other examples on SO about authentication but I have no idea how do I use authentication in Solrj. The below error comes only when I try to update a record (and possibly