solr

How to retrieve json in original nested form in apache solr?

折月煮酒 提交于 2019-12-25 08:04:03
问题 I am using apache solr for text search . I have nested document structure . This is one.json file : { "id": "1", "info": { "first_name": "John", "last_name": "Doe", "gender": "male" } } I created a solr core and posted one.json in it.Solr indexed and flattened the above document's nested structure , I guess for better indexing in following form: { "id":["1"], "info.first_name":["John"], "info.last_name":["Doe"], "info.gender":["male"] } Now, when I make the search query,the result is in

Unable to add Impressionist model to Solr

℡╲_俬逩灬. 提交于 2019-12-25 08:03:23
问题 To keep track of unique views I added impressionist gem. The impressions table will grow at a faster rate due to higher traffic. This will cause problems later when I want to show a comparison between consecutive weeks/months. So I thought of linking impression's model with solr . To implement this I first created a model named impression under app/models/impression.rb folder. class Impression < ActiveRecord::Base attr_accessible :user_id, :ip_address, :action_name, :controller_name,

Indexing using two tables in sunspot solr + rails 4

亡梦爱人 提交于 2019-12-25 07:54:43
问题 I'm using sunspot-solr in ROR and I need help in creating a searchable block using two tables.(join of two tables) The query I want to be executed when the indexes are formed is : SELECT a.id,a.title FROM table_one a,table_two b WHERE a.status=1 AND a.id=b.id AND b.status=1 I want the "title" field to be searchable(text), only if the id exists in both tables and both have status 1.And I want them to be stored fields(no db hits). class TableOne has_many :table_twos searchable do text :title,

How to perform bulk updates in Solr

懵懂的女人 提交于 2019-12-25 07:48:56
问题 Is there a way in Solr to perform bulk updates without specifying it document by document? 回答1: No, there is nothing similar to UPDATE foo SET field = "bar" - you'll have to either submit the complete set of updated documents, or a batches of atomic update commands (each related to a separate id). [{"id":"mydoc", "price":{"set":99}}, {"id":"mydoc2", "price":{"set":199}}] 来源: https://stackoverflow.com/questions/41372899/how-to-perform-bulk-updates-in-solr

How can I read and write the external file field in solr?

╄→尐↘猪︶ㄣ 提交于 2019-12-25 07:45:19
问题 I am using External File field in solr for my frequently updated types of data. I had created a file _external_<myfieldTypename > in my Index directory. And my data is like : 4950 = 150.0 4951 = 65.0 4952 = 789.0 4953 = 786.0 4954 = 5.0 4955 = 21.0 Now I had created new field as: <fieldType name="<myfieldTypename>" class="solr.ExternalFileField" keyField="Name" defVal="1" indexed="false" stored="false" valType="float"/> <field name="MyFieldName" type="<myfieldTypename>" indexed="true" stored=

Solr thinks an update is an add operation

一个人想着一个人 提交于 2019-12-25 07:27:40
问题 Solr version is 5.4.1 I posted this to http://localhost:8983/solr/default-collection/update and it treated it like I was adding a whole document, not a partial update: { "id": "0be0daa1-a6ee-46d0-ba05-717a9c6ae283", "tags": { "add": [ "news article" ] } } In the logs, I found this: 2016-02-26 14:07:50.831 ERROR (qtp2096057945-17) [c:default-collection s:shard1_1 r:core_node21 x:default-collection] o.a.s.h.RequestHandlerBase org.apache.solr.common.SolrException: [doc=0be0daa1-a6ee-46d0-ba05

How to insert multivalued field in solr using lily morphline row-based

依然范特西╮ 提交于 2019-12-25 07:26:11
问题 I am trying to insert a comma-seperated string as a multivalued field to my morphline configuration from a Row-based Structure in HBase. Can any one suggest any better way or experience I am new to this. Is there any way I can do that. HBase-Indexer Mapper: <?xml version="1.0"?> <indexer table="Document_Test" mapper="com.ngdata.hbaseindexer.morphline.MorphlineResultToSolrMapper" unique-key-field="documentId" mapping="row"> <param name="morphlineFile" value="/path/to/morphline.conf" /> <

Indexing and ordering by dynamic field with sunspot

徘徊边缘 提交于 2019-12-25 06:54:56
问题 So I have many items that can be part of many different pages. So here is the simplified models: class Page #we just need the id for this question end class Item embeds_many :page_usages end class PageUsage field :position, :default => 0 embedded_in :item belongs_to :page end So the page_usage is holding the position of the items on every page. I want to put that into solr so it can pull up the right items and in the right order for me. I've looked into dynamic fields and ended up with

apache nutch to index to solr via REST

淺唱寂寞╮ 提交于 2019-12-25 06:34:06
问题 newbie in apache nutch - writing a client to use it via REST. succeed in all the steps (INJECT, FETCH...) - in the last step - when trying to index to solr - it fails to pass the parameter. The Request (I formatted it in some website) { "args": { "batch": "1463743197862", "crawlId": "sample-crawl-01", "solr.server.url": "http:\/\/x.x.x.x:8081\/solr\/" }, "confId": "default", "type": "INDEX", "crawlId": "sample-crawl-01" } The Nutch logs: java.lang.Exception: java.lang.RuntimeException:

How to check that solr server is running

元气小坏坏 提交于 2019-12-25 06:26:39
问题 i have implemented search in my E commerce application. which hit solr(running on port 8983) to get the search result solr url is url =solrURL+"/solr/db/select/?qt=dismax&wt=json&&start="+start+"&rows="+end+"&q="+lowerCaseQuery+"&hl=true&hl.fl=text&hl.usePhraseHighlighter=true&sort= score desc ,"+sort+" "+order+"&json.wrf=?" and using getJson i am getting the solr response. $.getJSON(url, function(result){ now my problem is how can i determine that solr server is running. EDIT: $ .ajax({ url: