solrj

Correct use case of String parameter in SetQuery function of SolrQuery?

青春壹個敷衍的年華 提交于 2019-12-25 11:52:55
问题 I have q queryString = "select?wt=json&rows=0&indent=true&facet=true&q=*:*&facet=true&facet.field=outcome_type" If queried like : http://x.x.x.x:8983/solr/abc/queryString it works. here abc is a core. Now I would like to execute it programmatically, and using the following approach : SolrQuery query = new SolrQuery(); query.setQuery(queryString); QueryResponse resp = server.query(query); here queryString as defined above, but it return the following error : Exception in thread "main" org

Can Solr retain the formatting of the HTML documents whcih was fed to it in its result?

时光毁灭记忆、已成空白 提交于 2019-12-25 09:42:11
问题 How do I maintain the Original formatting of the HTML document in the results given by Solr? I am trying to provide search functionality in one of my companies website that is having millions of documents and all are not having similar formatting, So it is hard to individually format each document. I am using Solr 4.1 nightly builds at apache site which is having inbuilt support for solr-cell and tika. i.e. i need not to separately configure them. does solr-cell or tika retains these

Re-indexing SOLR document

眉间皱痕 提交于 2019-12-25 04:41:45
问题 I have one file named item.csv, which contains around 100 products for now and it is indexed using SOLR.My requirements is if I add more data around 10 to 100 products on daily basis, do I need to re-index the whole document daily,or does SOLR support indexing only those new data? Can anyone please clarify my question. Thanks in advance. 回答1: Yes, you can just add new documents to the index without having to rebuild the whole index. If you mean appending data to (or updating) an existing

How to add a new field to the document in a custom Solr Filter

半城伤御伤魂 提交于 2019-12-25 01:54:20
问题 I am writing a custom filter in Solr to post a token to Apache Stanbol for enhancement and index the response to a different field in the same document. In my test code below I have got the Stanbol response and have added it as a new document to Solr. My requirement is to add the stanbolResponse as a field value to the same document being indexed. I think this can be done if I can retrieve the document Id from the TokenStream in the filter. Can anyone please help me with a sample code/example

How to sort the top 100 results of solr query based on a specific filed?

爷,独闯天下 提交于 2019-12-25 01:25:44
问题 i want to sort the top 100documents of a solr using a specific field but it sort the whole result set and then display result the following is my code. query1.setQuery(" Natural Language "); query1.setStart(0); query1.setRows(100); int i=0; query1.set("df","Text"); query1.setFields("PaperID","TotalPageRank"); query1.setSort("customrank", SolrQuery.ORDER.desc); Is it possible using solr query to sort the top 100 documents using customrank field? 回答1: It is very simple.. SolrQuery query1 = new

WordCount example - option.builder() error (intelliJ, Solr, Spark)

穿精又带淫゛_ 提交于 2019-12-24 14:33:40
问题 I started to learn Solr and I am trying to write a WordCount-example with Solr and Spark. But I have problem, perhaps with the imports or with the dependencies. You can look at my code below.. My dependencies: <groupId>com.lucidworks.spark</groupId> <artifactId>spark-solr</artifactId> <version>2.1.0</version> <groupId>org.apache.solr</groupId> <artifactId>solr-solrj</artifactId> <version>7.6.0</version> My Code: object Solr extends SparkApp.RDDProcessor { def getName: String = "query-solr

SolrJ used to control Solr/Luce vs. Straight Rest Calls

给你一囗甜甜゛ 提交于 2019-12-24 14:04:09
问题 We are running a TomCat servlet (Railo) for a public facing REST application. I've started implementing SolrJ to control a standalone Solr cluster. Queries are working well, but I'm scratching my head over the flow vs. just using the straight HTTP interface Solr provides. I thought there was some performance benefit to using SolrJ which is why I started implementing it, but from what I'm reading and seeing in response times, I think I was wrong on that account (?). Is there any real advantage

Solr 4.0.0 define <uniqueKey> id</uniqueKey> as a “long” type throws an error on startup

三世轮回 提交于 2019-12-24 12:49:00
问题 In my entity clas, I defined id: @Field("id") protected Long id; then in solr4.0.0 schema.xml, i define: <field name="id" type="long" indexed="true" stored="true" /> <uniqueKey>id</uniqueKey> then solr throws exception on startup. If 'id' is defined as 'string' type, no exception. so my question is: what's the solution if i insisted on defining 'id' as long type. 回答1: Check SOLR-2997 It seems QueryElevationComponent needs the Unique key in String format. So if you don't need it you can remove

trouble in solr connect java

有些话、适合烂在心里 提交于 2019-12-24 06:29:14
问题 I try to use solr 6.5.0 to connect java . I have added following .jar files to the library: commons-io-2.5 httpclient-4.4.1 httpcore-4.4.1 httpmine-4.4.1 jcl-over-slf4j-1.7.7 noggit-0.6 slf4j-api-1.7.7 stax2-api-3.1.4 woodstox-core-asl-4.4.1 zookeeper-3.4.6 solr-solrj-6.5.0 but when i try use following code to connect the solr: import org.apache.http.impl.bootstrap.HttpServer; import org.apache.solr.client.solrj.SolrQuery; import org.apache.solr.client.solrj.SolrServerException; import org

Price Range Filter with Slider UI with Min & Max value from Solr in same query?

余生长醉 提交于 2019-12-24 01:27:56
问题 I'm working on an Solr integration for an e-commerce site. I want to offer a jQuery Slide Range UI (refer http://jqueryui.com/slider/#range). So visitor will be offered with a slider with min and max price on the page which they can use to define a range and accordingly the filter is applied. On Solr side, I understand how to make a range filter query on this. However, for displaying a range I need min and max price value. I'm not sure how to get this from Solr. Moreover, when other facets