solrj

Implementing Tagging and Excluding Filters with Solrj / Spring Data Solr

纵饮孤独 提交于 2019-12-01 20:59:14
I am trying to implement a Solr Facet search with multi-select on a field. To take this example: http://docs.lucidworks.com/display/solr/Faceting#Faceting-LocalParametersforFaceting , I would like to generate this call to solr: q=mainquery&fq=status:public&fq={!tag=dt}doctype:pdf&facet=on&facet.field={!ex=dt}doctype I am not sure how to call this using solrj (java) as I don't want to add a simple filed but I need to include the tagging and excluding (!tag=dt and !ex=dt). Any ideas what the java code should look like? I am using Spring-Data-Solr which seems to be too basic to make such an

How can I transform SolrQuery(SOLRJ) to URL?

≯℡__Kan透↙ 提交于 2019-12-01 17:52:19
While using SOLRJ I would like to know how can I convert SolrQuery object to its URL representation with SOLR query syntax. I tried to use .toString() method but it doesnt return proper query representation. Is there some other way how to do it? I recommend ClientUtils.toQueryString for this matter. @Test public void solrQueryToURL() { SolrQuery tmpQuery = new SolrQuery("some query"); Assert.assertEquals("?q=some+query", ClientUtils.toQueryString(tmpQuery, false)); } Within the source code of HttpSolrServer you can see that this is used by the Solrj code itself for this reason. public

What is the default address of Solr Server (Solr 4.0) for use from a SolrJ client

不打扰是莪最后的温柔 提交于 2019-12-01 17:13:50
I'm trying to connect with Solr Server from a SolrJ client, but it gives an HTTPResponse Exception. Here's my code: SolrServer server = new HttpSolrServer("http://"localhost":8983/solr/"); Here's the exception: java.lang.NoClassDefFoundError: org/apache/http/NoHttpResponseException: Does Solr have a default address? Where can you find it? I am not familiar with SolrJ - but the endpoint seems to be missing the core name to me. You would need to point your Solr client to a particular core. The URI for the core would look like this (for reloading core command) http://localhost:8983/solr/{

Solr4.0的tomcat部署及Solrj的简单使用

早过忘川 提交于 2019-12-01 16:36:33
Solr简介 Solr是一个非常流行的,高性能的开源企业级搜索引擎平台,属于Apache Lucene项目。主要功能包括强大的全文检索、结果高亮、切面检索、动态聚类、数据库整合、富文本(例如Word,PDF)的处理,以及地理信息搜索。Solr是高度可扩展的,提供分布式检索和索引复制,并为世界上众多的大型网站提供搜索和导航功能。 Solr使用Java编写,可运行于servlet容器(如Tomcat)作为一个独立的全文搜索服务器。Solr以Lucene 为核心来创建索引和进行搜索,并提供类似REST的HTTP / XML和JSON API,这些API可以在任何编程语言中使用。通过Solr强大的扩展配置可适应几乎任何类型非Java编写应用程序,同时拥有丰富的插件来扩展高级功能。 Solr特性 先进的全文检索功能 专为高通量的网络流量进行的优化 基于标准的开放接口 - XML,JSON和HTTP 综合的HTML管理界面 暴露JMX接口以方便监控服务器统计 可扩展性 - 有效地复制到其他Solr搜索服务器 使用XML配置达到灵活性和适配性 可扩展的插件体系结构 Solr使用Lucene并进行了扩展 一个真正的拥有动态域(Dynamic Field)和唯一键(Unique Key)的数据模式(Data Schema) 对Lucene的查询语言进行了强大的扩展 切面搜索和过滤 地理空间信息搜索

How can I transform SolrQuery(SOLRJ) to URL?

穿精又带淫゛_ 提交于 2019-12-01 16:14:22
问题 While using SOLRJ I would like to know how can I convert SolrQuery object to its URL representation with SOLR query syntax. I tried to use .toString() method but it doesnt return proper query representation. Is there some other way how to do it? 回答1: I recommend ClientUtils.toQueryString for this matter. @Test public void solrQueryToURL() { SolrQuery tmpQuery = new SolrQuery("some query"); Assert.assertEquals("?q=some+query", ClientUtils.toQueryString(tmpQuery, false)); } Within the source

create new core directories in SOLR on the fly

こ雲淡風輕ζ 提交于 2019-12-01 15:37:50
i am using solr 1.4.1 for building a distributed search engine, but i dont want to use only one index file - i want to create new core "index"-directories on the fly in my java code. i found following rest api to create new cores using an EXISTING core directory ( http://wiki.apache.org/solr/CoreAdmin ). http://localhost:8983/solr/admin/cores?action=CREATE&name=coreX&instanceDir=path_to_instance_directory&config=config_file_name.xml&schema=schem_file_name.xml&dataDir=data is there a way to create a new core without an extisting core directory? has solr such a function? via rest or in the solrj

How can I sort solr result bases on dynamic fields

牧云@^-^@ 提交于 2019-12-01 14:42:26
Thanks for giving your time. I need to sort result on the basis of dynamic field. How can I do that ? when I am sorting on minimum value of some of those dynamic attribute. It's not giving correct result because my query is like &sort=min(A_160018,A_chandigarh1) Some of document having both field A_160018 and A_chandigarh1 while some document having no field and some having one either A_160018 or A_chandigarh1 for some result doc . could you help me , How can I sort for this type of dynamic field. If you do not know if the field exist, you can set a default value in case it does not exists.

indexing all documents in doc folder in to solr FileListEntityProcessor

喜你入骨 提交于 2019-12-01 11:39:57
http://wiki.apache.org/solr/ExtractingRequestHandler does not provide much information how to configure this handler in an webapplication which has its own context and want to use solr as server features as embebdedd solr . Can you please provide some information on how to upload the documents to solr and search for some content from those documents? I have configured DIH as in solrConf.xml <requestHandler name="/dataimport" class="org.apache.solr.handler.dataimport.DataImportHandler"> <lst name="defaults"> <str name="config">tika-data-config.xml</str> </lst> </requestHandler> and tika-data

How can I sort solr result bases on dynamic fields

假如想象 提交于 2019-12-01 10:32:51
问题 Thanks for giving your time. I need to sort result on the basis of dynamic field. How can I do that ? when I am sorting on minimum value of some of those dynamic attribute. It's not giving correct result because my query is like &sort=min(A_160018,A_chandigarh1) Some of document having both field A_160018 and A_chandigarh1 while some document having no field and some having one either A_160018 or A_chandigarh1 for some result doc . could you help me , How can I sort for this type of dynamic

indexing all documents in doc folder in to solr FileListEntityProcessor

人走茶凉 提交于 2019-12-01 10:22:10
问题 http://wiki.apache.org/solr/ExtractingRequestHandler does not provide much information how to configure this handler in an webapplication which has its own context and want to use solr as server features as embebdedd solr . Can you please provide some information on how to upload the documents to solr and search for some content from those documents? I have configured DIH as in solrConf.xml <requestHandler name="/dataimport" class="org.apache.solr.handler.dataimport.DataImportHandler"> <lst