sunspot

Sunspot geospatial search ERROR:unknown field 'location_ll'

ⅰ亾dé卋堺 提交于 2019-12-05 20:01:28
I've been trying to integrate geospatial search into my rails app for a few days now, but keep getting this error when I run rake sunspot:solr:reindex RSolr::Error::Http - 400 Bad Request Error: ERROR:unknown field 'location_ll' Request Data: "<?xml version=\"1.0\" encoding=\"UTF-8\"?><add><doc><field name=\"id\">Place 1</field><field name=\"type\">Place</field><field name=\"type\">ActiveRecord::Base</field><field name=\"class_name\">Place</field><field name=\"location_ll\">42.348065,-71.083623</field></doc> #etc... keeps going on for all the objects/fields being indexed in the table As far as

Solr/Lucene is it possible to order first by relevance, and then by a second attribute?

半城伤御伤魂 提交于 2019-12-05 17:53:49
问题 In Solr/Lucene is it possible to order first by relevance, and then by a second attribute? As far as I can tell if I set an ordering parameter, it totally overrides relevance, and sorts by the ordering parameter(s). How can I have results sorted first by relevance, and then in the case of two entries with exactly the same relevance, giving the nod to the item that, say, comes first alphabetically. If it makes any difference I'm using Solr through Sunspot in Ruby on Rails. 回答1: Solved my own

Sunspot and RSpec fail. The commit doesn't seem to be working

夙愿已清 提交于 2019-12-05 13:28:32
I've got a few tests running with RSpec for a Rails site, but despite following the instructions things aren't quite behaving themselves. I create an article via a Factory, run Sunspot.commit and then check the results. I always seem to draw a blank though. When I test it manually via the console or through the website it all works find though. Any ideas? How can I output the sunspot logs to see what's going on? My Gemfile has the following, and I'm running Rails 3.1.1 gem 'sunspot', '1.2.1' gem 'sunspot_rails' gem 'sunspot_test' Many thanks, Graeme It was my fault for not reading the manual

Sunspot / Solr full text search - how to index Rails associations

橙三吉。 提交于 2019-12-05 06:51:18
Is it possible to index through an association with Sunspot? For example, if a Customer has_many Contacts, I want a 'searchable' block on my Customer model that indexes the Contact#first_name and Contact#last_name columns for use in searches on Customer. acts_as_solr has an :include option for this. I've simply been combining the associated column names into a text field on Customer like shown below, but this doesn't seem very flexible. searchable do text :organization_name, :default_boost => 2 text :billing_address1, :default_boost => 2 text :contact_names do contacts.map { |contact| contact

Group using Sunspot/Solr?

喜欢而已 提交于 2019-12-05 05:25:32
问题 I'm having some problem searching by group when using Sunspot. Here is an example: # == Schema Information # # Table name: movies # # id :integer(4) not null, primary key # title :string(255) class Movie < ActiveRecord::Base has_and_belongs_to_many :actors searchable do text :title integer :ages, multiple: true do actors.map(&:age) end text :names, multiple: true do actors.map(&:name) end end end # == Schema Information # # Table name: actors # # id :integer(4) not null, primary key # name

RSolr::Error::InvalidRubyResponse - 200 OK

孤街醉人 提交于 2019-12-05 03:40:12
I am getting following error even after starting forreman and starting sunspot:solr : RSolr::Error::InvalidRubyResponse - 200 OK Error: <result status="1">java.lang.NullPointerException at org.apache.solr.handler.XmlUpdateRequestHandler.doLegacyUpdate(XmlUpdateRequestHandler.java:129) at org.apache.solr.servlet.SolrUpdateServlet.doPost(SolrUpdateServlet.java:87) at javax.servlet.http.HttpServlet.service(HttpServlet.java:727) at javax.servlet.http.HttpServlet.service(HttpServlet.java:820) at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511) at org.mortbay.jetty.servlet

rake sunspot:solr:reindex not working in Rails 4 app with multiple engines

时光怂恿深爱的人放手 提交于 2019-12-05 01:38:01
问题 I have rails 4 beta1 application with multiple engines. I've installed sunspot_rails gem /2.0.0.pre.130115/ in my host application. Most of my models lived in engine1. I used them on other engines. After I installed sunspot_rails, using rake sunspot:solr:run I got command/task not found . According to documentation I found a solution. Here is the link: https://github.com/sunspot/sunspot/wiki/Adding-Sunspot-search-to-Rails-in-5-minutes-or-less After I created a new record Solr found it in a

connection rejected from solr in Rspec

為{幸葍}努か 提交于 2019-12-04 18:56:50
问题 I use the sunspot-rails for search. These is a Rspec looks like: describe "GET search" do before(:all) do system("rake", "sunspot:solr:start") end after(:all) do system("rake", "sunspot:solr:stop") end it "should do some search" do Text.search do ... end end end But it doesn't work. I got a failure: Errno::ECONNREFUSED: Connection refused - connect(2) But if I type rake sunspot:solr:start RAILS_ENV=test by hand in command line, and then run the spec, it passes. What's wrong? Isn't rake

Rails 4: RSolr::Error::Http (RSolr::Error::Http - 404 Not Found

眉间皱痕 提交于 2019-12-04 18:54:07
问题 I am in the process of upgrading my app to Rails 4, and now got my rails server, as well as sunspot solr, after a lot of tinkering, to run, I can access Solr admin page. However when I try to access solr from my rails development app to do search or index, I get the following error RSolr::Error::Http (RSolr::Error::Http - 404 Not Found Error: Not Found Request Data: "fq=type%3AMatch&fq=date_in_utc_d%3A%7B2013%5C-11%5C-29T21%5C%3A00%5C%3A00Z+TO+%2A%7D&fq=approval__s%3AAPPROVED&sort=date_d+asc

Geospatial Indexing with Redis & Sinatra for a Facebook App

匆匆过客 提交于 2019-12-04 14:50:17
I'm rebuilding Lovers on Facebook with Sinatra & Redis, and I want: Set operations for managing requests & relationships between users Geospatial indexing to display nearby app users Current Redis Implementation Each user has two Redis ordered sets ( reqSent & reqRecv ) that store uids. The SCORE that we order the requests by is the time (UNIX timestamp) the request was made. I am using ordered sets instead of lists because a user may only make The request type (rid) is encoded as a number and prepended to the uid. (rid|uid) E.g., for the user with uid=100, we might have: 100:reqSent => ["1