solr

Configuring Solr to use UUID as a key

自闭症网瘾萝莉.ら 提交于 2019-12-29 09:02:32
问题 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=

parse Solr xml files to SolrInputDocument

北慕城南 提交于 2019-12-29 08:48:08
问题 If I have individual files in the expected Solr format (having just ONE doc per file): <add> <doc> <field name="id">GB18030TEST</field> <field name="name">Test with some GB18030 encoded characters</field> <field name="features">No accents here</field> <field name="features">ÕâÊÇÒ»¸ö¹¦ÄÜ</field> <field name="price">0</field> </doc> </add> Is not there a way to easily marshal that file into a SolrInputDocument? Do I have to do the parsing myself? EDIT: I need it in java pojo cause I want to

Too many boolean clauses exception in solr

余生颓废 提交于 2019-12-29 08:36:34
问题 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

How do I return only a truncated portion of a field in SOLR?

柔情痞子 提交于 2019-12-29 08:35:13
问题 I have a really large (5000+ characters) text field in SOLR named Description . So far it works great for searching and highlighting. If I perform a search and there are no highlighted portions then I just show the first 300 characters. What I would like to do is just return the 300 characters in the result from SOLR. I would like to do this because when testing I get improved performance if I return a smaller result. This is probably because the XML doc is smaller so less time on the wire

How do I find documents containing digits and dollar signs in Solr?

痞子三分冷 提交于 2019-12-29 08:07:11
问题 In Solr, I've got text that contains $30 and 30. I would like to search for $30 and only find documents containing $30. But if someone searches for 30, they should find both documents containing $30 and those containing 30. Here is the field type I'm currently using to index my text field: <!-- Just like text_en_splitting, but with the addition of reversed tokens for leading wildcard matches --> <fieldType name="text_en_splitting_reversed" class="solr.TextField" positionIncrementGap="100"

Can't reindex Sunspot SOLR - Error - RSolr::Error::Http - 500 Internal Server Error

人走茶凉 提交于 2019-12-29 07:29:31
问题 Everytime i try to reindex using... rake sunspot:solr:reindex These error messages always show: Error - RSolr::Error::Http - 500 Internal Server Error - retrying... Error - RSolr::Error::Http - 500 Internal Server Error - ignoring... Error - RSolr::Error::Http - 500 Internal Server Error - retrying... Error - RSolr::Error::Http - 500 Internal Server Error - ignoring... I tried to stop then start using... rake sunspot:solr:stop rake sunspot:solr:start But nothing happened. And now everytime I

Solr - How to boost score for early matches?

旧城冷巷雨未停 提交于 2019-12-29 06:55:42
问题 How can I boost the score for documents in which my query matches a particular field earlier. For example, searching for "super man" should give "super man returns" a higher score than "there is my super man". Is this possible? 回答1: Check for options @ Ranking-based-on-term-position 回答2: Solved it myself after reading a LOT about this online. What specifically helped me was a reply on nabble which goes like (I used dismax, so explaining that here): Create a separate field named say

Stronger boosting by date in Solr

我的梦境 提交于 2019-12-29 03:21:41
问题 Boosting by date field in solr is defined as: {!boost b=recip(ms(NOW,datefield),3.16e-11,1,1)} I looked everywhere (examples: Solr Dismax Config for Boost Scoring and Solr boost for multivalued date field and they all reference the SolrRelevancyFAQ), same definition that is used. But I found that this is not boosting my results sufficiently. How can I make this date boosting stronger? User is searching for two keywords. Both items contain both keywords (in same order) in both title and

How to set Apache solr admin password

霸气de小男生 提交于 2019-12-28 05:14:35
问题 I an not very familiar with solr. I have installed solr successfully. It is using jetty webserver. My solr version is 4.10.3. It admin page is not protected by password. Anyone can access it. I want to apply a paaword on solr admin. How I will do it? 回答1: For version below 5 If you are using solr-webapp then you need to modify web.xml file and add these lines: <security-constraint> <web-resource-collection> <web-resource-name>Solr Lockdown</web-resource-name> <url-pattern>/</url-pattern> <

Restricting IP addresses for Jetty and Solr

白昼怎懂夜的黑 提交于 2019-12-28 04:20:05
问题 I'm setting up Solr using Jetty. I would like to restrict access to only a few IP addresses. It doesn't seem immediately obvious that this can be done using Jetty. Is it possible and if so, how? 回答1: Solr 4.2.1 uses Jetty 8.1.8. Jetty 8 (as noted by jonas789) doesn't support .htaccess. Instead, it uses IPAccessHandler, which doesn't have great documentation available. I had to play with it quite a bit to get it work, so I'm posting an updated solution here. IPAccessHandler manages a blacklist