solr

Haystack more_like_this returns all

亡梦爱人 提交于 2019-12-22 21:55:44
问题 I am using Django, haystack, solr, to do searching. Ive am able to search and now I would like to find similar items using more_like_this. When I try to use the more_like_this functionality I get back all of the objects that are of that model type instead of just the ones that closely match it. Here is some code to show you how I am using it: def resource_view(request, slug): resource = Resource.objects.get(slug=slug) versions = Version.objects.get_for_object(resource) related =

How can I set up Solr to tokenize on whitespace and punctuation?

谁说胖子不能爱 提交于 2019-12-22 18:47:10
问题 I have been trying to get my Solr schema (using Solr 1.3.0) to create terms that are tokenized by whitespace and punctuation. Here are some examples on what I would like to see happen: terms given -> terms tokenized foo-bar -> foo,bar one2three4 -> one2three4 multiple words/and some-punctuation -> multiple,words,and,some,punctuation I thought that this combination would work: <fieldType name="text" class="solr.TextField" positionIncrementGap="100"> <analyzer type="index"> <tokenizer class=

Conditional sorting in Solr 3.6

亡梦爱人 提交于 2019-12-22 18:33:19
问题 We're running Solr 3.6 and are trying to apply a conditional sort on the result set. To clarify, the data is a set of bids, and we want to add the option to sort by the current user's bid, so it can't function as a regular sort (as the bid will be different for each user that runs the query). The documents in the result set include a "CurrentUserId" and "CurrentBid" field, so I think we need something like the following to sort: sort=((CurrentUserId = 12345) ? CurrentBid : 0) desc This is

How Do I Scope Enums in Rails Using Sunspot?

北城余情 提交于 2019-12-22 18:19:49
问题 I am trying to use Sunspot (Rails Solr gem) to scope results using an enum I have declared in my model. The relevant portion of my model looks like this: searchable do text :tag_list boolean :approved integer :perspective time :created_at end enum perspective: [ :not_applicable, :front, :side_front, :side, :side_back, :back, :above, :below ] My search block in my controller looks like this: def index //skip scoping if perspective is nil params[:perspective] ||= [] @search = Upload.search do

Multiple Cores in Django Haystack using Solr Backend

时光总嘲笑我的痴心妄想 提交于 2019-12-22 17:59:43
问题 How do I configure HAYSTACK_SOLR_URL when using multiple cores? I've set it to the address of core0, and that works, but only using one core… The docs aren't that obvious to me… it just says ... # ...or for multicore... HAYSTACK_SOLR_URL = 'http://127.0.0.1:8983/solr/mysite' What is mysite? I'm actually running apache-solar-3.3.0/example with the multicore directory copied over the example directory, and the schema and conf files/directories updated. Many thanks. 回答1: <cores adminPath="/admin

Does Solr data import handler support custom variables?

被刻印的时光 ゝ 提交于 2019-12-22 17:41:03
问题 I currently have an issue with my data import handler where ${dataimporter.last_index_time} is not granular enough to capture two events that happen within a second of each other, leading to issues where a record is skipped over in my database. I am thinking to replace last_index_time with a simple atomically incrementing value as opposed to a datetime, but in order to do that I need to be able to set and read custom variables through solr that can be referenced in my data-config.xml file.

Solr highlighting without stop-words for phrases?

雨燕双飞 提交于 2019-12-22 15:49:42
问题 I am trying to highlight results in Solr and up until now, it's been a struggle of tweaking here and there... My main concern now is that i got the highlighting phrases thing working, but if i search for something like "The World Cup At Brazil: An Unexpected Challenge" The highlighting field will return: "World Cup Brazil: Unexpected Challenge" I think this might be due to the stop words (my field is a 'textgen' type, btw). Is there some kind of parameter to run in the query that would return

Running Search workload and Cassandra workload on the same physical node

孤街浪徒 提交于 2019-12-22 13:58:31
问题 Can't seem to find the answer to this obvious question. We have 6 servers currently configured as "Search" workload running DSE. My question is: Is it possible to run Search (Solr) and Cassandra on the same physical box? (Not) Possible / (Not) Recommended? I'm very confused with the fact that we currently are running all nodes as Solr nodes and I'm still able to use them as Cassandra (real time queries) - so it's technically both? The "Services /Best Practice" tells me that: "Please replace

Solr: Using the Block Join Children Query Parser

…衆ロ難τιáo~ 提交于 2019-12-22 13:57:31
问题 Currently I evaluate the Block Join Children Query Parser as described here. Therefore I have created the following collection: curl "http://localhost:8983/solr/admin/collections?action=CREATE&name=nestedPerson&numShards=6"` Then I have inserted these two documents: curl http://localhost:8983/solr/nestedPerson/update?commitWithin=3000 -d '<add> <doc> <field name="id">p1</field> <field name="deceased">false</field> <doc> <field name="id">c1</field> <field name="firstName">Bob</field> </doc> <

How can I Ignore some fields in a SOLR query

大兔子大兔子 提交于 2019-12-22 13:06:08
问题 I have Solr 5.3.1 and need to do query for all field except some field (what I need search in some field not retrieve fields this way to retrieve [/?q=query&fl=field1,field2,field3] ) i try with some solution but not work 1.How to exclude fields in a SOLR query [this soluation not work] 2.[the below solution work but take more time] query = field1:"+txtSearch+"OR field1:"+ txtSearch+" OR field1:"+txtSearch 3.I set indexed="false" in data-config.xml it only Ignore search in this field but when