solr

Load balancer for solrcloud

那年仲夏 提交于 2019-12-12 02:08:24
问题 We are hitting one of the solr instances in solrcloud architecture directly from a .Net application. If that instance is down, then the request need to be served by another live instance. This is possible with load balancer. What options are available for this and which can be used best? Solr cloud is in Windows. Please suggest since Solrj is not being used here. Thanks in advance. 回答1: Any load balancer would do. We are using nginx without trouble. If you need something analogous to SolrJ,

How to highlight all matched word in single snippet in solr

拥有回忆 提交于 2019-12-12 02:03:09
问题 All: Right now, I am using SOLR highlight feature, but one thing I want to ask is: Suppose I want to search keyword fund and value: fund AND value And the return highlight part is like: "highlighting": { "blk_0019": { "content": [ "philosophy of the <em>fund</em> – <em>value</em> and turning point. \n \n MUSA was an orphaned" ] }, "blk_0006": { "content": [ "Global Equities <em>Fund</em> Ltd. \n \n CONFIDENTIAL enclosed" ] } } The problem is I am sure blk_0019 and blk_0006 have both fund and

Multiple updates simultaneously on same document in solr

99封情书 提交于 2019-12-12 01:59:10
问题 I have a doubt regarding solr document update. For example, when two requests to update a document in solr comes at the same time, How does solr work? Does it take one request randomly and locks write before next request comes in? Thanks in Advance 回答1: There are different Locking mechanisms as mentioned in Lucene locking factory docs. By default NativeFSLockFactory is used in which file lock is acquired for the document that is being indexed. The settings for using a different locking

How to select from Solr in Java code?

点点圈 提交于 2019-12-12 01:56:03
问题 I save data in Solr: String solrUrl = "http://localhost:8984/solr"; SolrServer solrServer = new HttpSolrServer( solrUrl ); SolrInputDocument doc = new SolrInputDocument(); doc.addField("id", "1"); doc.addField("first_name", "Ann"); doc.addField("last_name", "Smit"); doc.addField("email", "test@test.com"); try { solrServer.add(doc); solrServer.commit(); } catch (SolrServerException e) {/* */} And I want to search in solr: SolrQuery parameters = new SolrQuery(); parameters.setQuery("*:*");

How to get Solr result as per their scores

£可爱£侵袭症+ 提交于 2019-12-12 01:55:58
问题 I am working on Solr with ASP.Net MVC. I want to display result as per score result . It means if I search for any keyword, it gives me total 500 result. But I want only first 100 Results. I also display scores for results using following query: Fields = new[] {"*","score"}, I want results which have score more than 0.3 How can I do this in Solr? Also a solrnet query to get this result. Please advise. Thank you. 来源: https://stackoverflow.com/questions/26842830/how-to-get-solr-result-as-per

Solr 5.5.0 response is not proper

£可爱£侵袭症+ 提交于 2019-12-12 01:43:51
问题 solr mysql response is not proper am using solr 5.5.0 this is my codes <dataconfig> <datasource type="JdbcDataSource" driver="com.mysql.jdbc.Driver" url="jdbc:mysql://localhost/dbname" user="user" password="password"/> <document name="user"> <entity name="user" query="select * from user"> <field column="id" name="id"/> <field column="name" name="name"/> </entity> </document> </dataconfig> schema.xml schema file ,I am retrieving id and name indexed <field column="name" name="name" indexed=

Alfresco Solr SearchService.query() error parsing Xpath

…衆ロ難τιáo~ 提交于 2019-12-12 01:32:56
问题 I'm trying to query for some files in Alfresco using SearchService; my idea is: 1) get folder's noderef where I want to search in for files 2) then get noderef's path via NodeService 3) finally query Solar via SearchService to find files in that specific path The problem raises when querying to Solr, I get the following exception: ERROR [solr.core.SolrCore] [http-bio-8443-exec-1] org.apache.solr.common.SolrException: org.apache.lucene.queryParser.ParseException: **Cannot parse** 'PATH:"/{http

Lucene vs Solr, indexning speed for sampe data

别说谁变了你拦得住时间么 提交于 2019-12-12 01:21:31
问题 I have worked upon Lucene before and now moving towards Solr. The problem is that I am not able to do Indexing on Solr as fast as Lucene can do. My Lucene Code: public class LuceneIndexer { public static void main(String[] args) { String indexDir = "/home/demo/indexes/index1/"; IndexWriterConfig indexWriterConfig = null; long starttime = System.currentTimeMillis(); try (Directory dir = FSDirectory.open(Paths.get(indexDir)); Analyzer analyzer = new StandardAnalyzer(); IndexWriter indexWriter =

SOLR - delta import not with last_modified

你说的曾经没有我的故事 提交于 2019-12-12 01:17:46
问题 I saw only ways using delta import with last_modified. Is there some other ways to do delta_imports withut using timestamps? For example, if i have unique key(integer), can i tell SOLR to index only those, which are greater then my last unique key? 回答1: So you could definitely hack this in yourself. However, what about if you manipulate an existing row? If you use last unique key you won't know that an existing row changed... Can you explain more fully the usecase for this? Trying to think of

solr java.lang.NoClassDefFoundError: org/apache/solr/common/ResourceLoader

六月ゝ 毕业季﹏ 提交于 2019-12-12 01:14:18
问题 For a tests reason I am trying locally to use EmbeddedSolrSolver (I know it's deprected it's only for tests). I was fallowing this example http://balabtech.wordpress.com/2011/10/13/embedded-solr-server-using-java/ and the official wiki as well http://wiki.apache.org/solr/Solrj I am still gettinga an error java.lang.NoClassDefFoundError: org/apache/solr/common/ResourceLoader at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:787) at java