solrj

Solr Change CommonsHttpSolrServer To HttpSolrServer

為{幸葍}努か 提交于 2019-11-29 21:46:35
问题 For Basic Authentication in solr 3.5 I am using the following code, String url = "http://192.168.192.11:8080/solr/FormResponses"; CommonsHttpSolrServer server = new CommonsHttpSolrServer( url ); String username = "user"; String password = "user123"; Credentials defaultcreds = new UsernamePasswordCredentials(username, password); server.getHttpClient().getState().setCredentials(AuthScope.ANY, defaultcreds); server.getHttpClient().getParams().setAuthenticationPreemptive(true); In solr 4.0

Configuring Solr to use UUID as a key

二次信任 提交于 2019-11-29 15:19:21
I am trying to configure Solr 4 to work with UUID and so far I am unsuccessful From reading the documentation I have seen two different ways to configure schema.xml to work with UUID (both do not work) for both I need to write <fieldType name="uuid" class="solr.UUIDField" indexed="true" /> option 1: add: <field name="id" type="uuid" indexed="true" stored="true" default="NEW" multiValued="false"/> and make sure to remove the line <uniqueKey>id</uniqueKey> option 2 add: <field name="id" type="uuid" indexed="true" stored="true" required="true" multiValued="false" /> Both options are not working

How to return distance and score in spatial search using spring-data-solr

不羁岁月 提交于 2019-11-29 15:18:12
问题 I'm writing a Spring MVC based Search API using spring-data-solr 1.0.0.RELEASE with Solr 4.4.0 and Spring 3.2.4.RELEASE. I'm able to run basic queries but unable to find any good example how can I return score and distance:geodist() in the results. I know I can get results from Solr using query like http://localhost:8983/solr/events/select?q=*:*&spatial=true&pt=51.435872%2C-0.427529&sfield=position&d=20&facet=true&facet.mincount=1&facet.limit=-1&facet.field=categoryIds&fl=score,*,distance

Solr running on Https - SolrJ Connection issue

旧时模样 提交于 2019-11-29 14:44:27
Am running Solr in Https(8443) port on top of tomcat, How can i access that solr using solrj client, I can see only CommonsHttpSolrServer is availble, Please suggest is there any way to access the https port enabled solr using SolrJ?. Solrj internally uses Apache Http Client . When using CommonsHttpSolrServer it will create one & use it, if you are not providing it with one. In this case since you need support for SSL you could provide your own SSL configured HttpClient to CommonsHttpSolrServer constructor. Check its API that accepts HttpClient. CommonsHttpSolrServer(String solrServerUrl,

Too many boolean clauses exception in solr

ぐ巨炮叔叔 提交于 2019-11-29 13:44:57
I am facing these problem while using OR , logical operator in framing query. I dont want to increase the maxBooleanClause value. Is there any other option than this. My OR range can go upto like 2 millions.I would rather want that if range of maxBooleanClause is exceeded than solr splits up the query, & finally merge all the subqueries. Is something of these sort possible? Or if any of you can suggest some better technique to do this. I want to plot a graph where user provide some range of dates for e.g. between 2013-03-01 to 2013-06-01 gives all the visitors visiting the app. Here i want to

Call Solr asynchronous from Play Framework

China☆狼群 提交于 2019-11-29 12:08:46
I have created a Play 2.1 Scala application. I am uncertain what's the best way to call Solr from a Play application: There is no Solr module for Play 2. AFAIK all Solr-APIs like SolrJ are blocking. I could wrap a SolrJ call into a Future , but this will also block a thread, correct? Should I use the play.api.libs.ws.WS library to call Solr and use Plays JSON support to extract the result (like in the example below) or is there any easier/faster way? val solrQuery: Future[play.api.libs.ws.Response] = WS.url("http://localhost:8983/solr/collection1/select?q=id%3A123&wt=json").get() Here's how I

How Get Suggestions from Solr Server in a PHP variable

佐手、 提交于 2019-11-29 12:05:50
I've got this problem that I can't solve. Partly because I can't explain it with the right terms. I'm new to this so sorry for this clumsy question. Below you can see an overview of my goal. I'm using Magento CE 1.7.0.2 & Solr 4.6.0. Working with Spell checker in Solr I'm Searching with iphon instead of iphone the solr Spell Checker throwing these suggestions. <response> <lst name="responseHeader"> <int name="status">0</int> <int name="QTime">48</int> </lst> <str name="command">build</str> <result name="response" numFound="0" start="0"></result> <lst name="spellcheck"> <lst name="suggestions">

How to perform a remote Solr core backup through SolrJ client?

梦想的初衷 提交于 2019-11-29 11:30:55
I want to write a java client based on SolrJ which pulls the entire core data to a file from a remote Solr server. Later on I want to replay this file to another remote Solr server core. What is the best method to implement this functionality? It's now possible with latest Solr versions. To achieve backup on one Solr Server and restore on another one needs to do the following: For each Solr installation in solr.xml setup backup repository to point to some shared drive. For example, one can use HDFS (this config requires -Dsolr.hdfs.home=... to be added into start script): <solr> ... <backup>

使用SolrJ(即java客户端)开发Solr。

帅比萌擦擦* 提交于 2019-11-29 09:40:29
1、什么是SolrJ呢?   答:Solrj是访问Solr服务的java客户端,提供索引和搜索的请求方法,SolrJ通常在嵌入在业务系统中,通过SolrJ的API接口操作Solr服务。开始配置schema.xml,/home/hadoop/soft/solr-4.10.3/example/solr/collection1/conf。添加IK中文分析器,然后定义定义自己的业务域。 注意:   a、Indexed,Indexed Field可以进行搜索和排序。你还可以在indexed Field上运行Solr分析过程,此过程可修改内容以改进或更改结果。   b、Stored,Stored Field内容保存在索引中。这对于检索和醒目显示内容很有用,但对于实际搜索则不是必须的,例如,很多应用程序存储指向内容位置的指针而不是存储实际的文件内容。 1 [root@localhost tomcat]# cd /home/hadoop/soft/solr-4.10.3/ 2 [root@localhost solr-4.10.3]# ls 3 bin CHANGES.txt contrib dist docs example licenses LICENSE.txt LUCENE_CHANGES.txt NOTICE.txt README.txt SYSTEM_REQUIREMENTS.txt

SOLRJ-6.0.0: Insertion of a bean object which associate list of bean object is giving null pointer exception

爱⌒轻易说出口 提交于 2019-11-29 05:09:33
Employee Bean Class: public class Employee2 { private String id; private String name; private String designation; private double salary; private double totalExperience; // private Address2 address2; private Collection<Technology2> technologies2; private String content_type = "employee2"; public Employee2() { super(); } public Employee2(String id, String name, String designation, double salary, double totalExperience, Collection<Technology2> technologies2) { super(); this.id = id; this.name = name; this.designation = designation; this.salary = salary; this.totalExperience = totalExperience; //