solr4

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

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);

Migration of solr cores after solr version upgradation from 4.10.4 to 6.6.0 on Cent os 7

走远了吗. 提交于 2019-12-10 12:17:16
问题 I have upgraded apache solr from 4.10.4 to 6.6.0 on Cent os 7 server, with the help of Upgrade Apache Solr from 4.10.4 to 6.6.0 on Cent os 7 I have taken backup of old solr core namely sample_core in /home/user/old_solr/sample_core folder How can I migrate my old solr(4.10.4) data in new solr version (6.6.0) 回答1: Make sure solr is running sudo service solr status Create new solr core by name sample_core use solr user sudo su solr Create sample_core /opt/solr-6.6.0/bin/solr create -c sample

How to extract metatags from HTML files and index them in SOLR and TIKA

筅森魡賤 提交于 2019-12-10 00:24:50
问题 I am trying to extract the metatags of HTML files and indexing them into solr with tika integration. I am not able to extract those metatags with Tika and not able to display in solr. My HTML file is look like this. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <meta name="product_id" content="11"/> <meta name="assetid" content="10001"/> <meta name="title" content="title of the article"/> <meta name="type" content="0xyzb"/> <meta name="category" content="article category

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

Solr query for matching nested/relational data

耗尽温柔 提交于 2019-12-09 15:59:13
问题 I'm using apache solr for the matching functionality of my webapp, and I encountered a problem of this scenario: I got three programmer, the skill field are their skills, "weight" means how well that skill he/she has: { name: "John", skill: [ {name: "java", weight: 90}, {name: "oracle", weight: 90}, {name: "linux", weight: 70} ] }, { name: "Sam", skill: [ {name: "C#", weight: 98}, {name: "java", weight: 75}, {name: "oracle", weight: 70}, {name: "tomcat", weight: 70}, ] }, { name: "Bob", skill

How can I do indexing .html files in SOLR

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-07 07:37:04
问题 The files I want to do indexing is stored on the server(I don't need to crawl). /path/to/files/ the sample HTML file is <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <meta name="product_id" content="11"/> <meta name="assetid" content="10001"/> <meta name="title" content="title of the article"/> <meta name="type" content="0xyzb"/> <meta name="category" content="article category"/> <meta name="first" content="details of the article"/> <h4>title of the article</h4> <p class

Faceting using SolrJ and Solr4

走远了吗. 提交于 2019-12-07 06:32:09
问题 I've gone through the related questions on this site but haven't found a relevant solution. When querying my Solr4 index using an HTTP request of the form &facet=true&facet.field=country The response contains all the different countries along with counts per country. How can I get this information using SolrJ? I have tried the following but it only returns total counts across all countries, not per country: solrQuery.setFacet(true); solrQuery.addFacetField("country"); The following does seem

Solr 4 - missing required field: uuid

房东的猫 提交于 2019-12-07 03:27:30
问题 I'm having issues generating a UUID using the dataImportHandler in Solr4. Im trying to import from an existing MySQL database. My schema.xml contains: <fields> <field name="uuid" type="uuid" indexed="true" stored="true" required="true" /> <field name="id" type="string" indexed="true" stored="true" required="true"/> <field name="address" type="text_general" indexed="true" stored="true"/> <field name="city" type="text_general" indexed="true" stored="true" /> <field name="county" type="string"

Solr: Sort by score & an int field value

若如初见. 提交于 2019-12-06 20:38:48
I need to sort documents returned in order of (descending) score & (descending) value of an int field within the document. How do I ensure proper sort order as well as good performance ? I don't need the sort-order defined by sort=score desc,intField desc . The sort order needs to be somewhat like what will be delivered using product function of score * fieldVal as effective score for sort order. But I don't need exact product for sorting. Approximations are ok, & this is just to roughly define the sort order I need. I can see a few possible ways to accomplish this: 1. Use a customized