sunspot-solr

Rails sunspot-solr - words with hyphen

谁说胖子不能爱 提交于 2019-12-06 04:51:11
I'm using the sunspot_rails gem and everything is working perfect so far but: I'm not getting any search results for words with a hyphen. Example: The string "tron" returns a lot of results(the word mentioned in all articles is e-tron) The string "e-tron" returns 0 results even though this is the correct word mentioned in all my articles. My current schema.xml config: <fieldType name="text" class="solr.TextField" omitNorms="false"> <analyzer type="index"> <tokenizer class="solr.StandardTokenizerFactory"/> <filter class="solr.StandardFilterFactory"/> <filter class="solr.LowerCaseFilterFactory"/

sunspot solr how to search multiple models correctly? All examples online fail

跟風遠走 提交于 2019-12-05 00:34:17
问题 How would one correctly search multiple models in SunSpot Solr? Profile model has_one :match searchable do string :country string :state string :city end Match model belongs_to :profile searchable do string :looking_for_education integer :age_from integer :age_to end ProfilesController#Index def index @search = Sunspot.search Profile, Match do with(:country, params[:country]) with(:state, params[:state]) with(:looking_for_education, params[:looking_for_education]) <= from the 2nd model end

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

sunspot solr how to search multiple models correctly? All examples online fail

久未见 提交于 2019-12-03 15:22:09
How would one correctly search multiple models in SunSpot Solr? Profile model has_one :match searchable do string :country string :state string :city end Match model belongs_to :profile searchable do string :looking_for_education integer :age_from integer :age_to end ProfilesController#Index def index @search = Sunspot.search Profile, Match do with(:country, params[:country]) with(:state, params[:state]) with(:looking_for_education, params[:looking_for_education]) <= from the 2nd model end @profiles = @search.results end This fails with: Using a with statement like with(:age).between(params[

Querying multiple models with different attributes using Sunspot

怎甘沉沦 提交于 2019-12-03 09:56:51
问题 I'm using Sunspot to index and search several models in a Rails project and I need to limit results based on the models' HABTM associations with a Department model. This is because users may not have permission to see records in all departments so results from those departments shouldn't be returned. Here are the important parts of two of the models: class Message < ActiveRecord::Base has_many :comments, dependent: :destroy has_and_belongs_to_many :departments searchable do text :title, :body

Querying multiple models with different attributes using Sunspot

北战南征 提交于 2019-12-03 00:28:07
I'm using Sunspot to index and search several models in a Rails project and I need to limit results based on the models' HABTM associations with a Department model. This is because users may not have permission to see records in all departments so results from those departments shouldn't be returned. Here are the important parts of two of the models: class Message < ActiveRecord::Base has_many :comments, dependent: :destroy has_and_belongs_to_many :departments searchable do text :title, :body text :comments do comments.map(&:body) end date :created_at integer :department_ids, using:

View raw Solr tokens for a single field on a single document

﹥>﹥吖頭↗ 提交于 2019-12-01 05:19:06
I'm debugging my Solr schema and I'd like to see the results of tokenizing a specific field. For a simplified example, if I have: <fieldType name="text" class="solr.TextField" omitNorms="false"> <analyzer> <tokenizer class="solr.StandardTokenizerFactory"/> <filter class="solr.StandardFilterFactory"/> <filter class="solr.LowerCaseFilterFactory"/> <filter class="solr.PorterStemFilterFactory"/> <filter class="solr.EdgeNGramFilterFactory" minGramSize="2" maxGramSize="15" side="front"/> </analyzer> </fieldType> and I indexed a field with the value "Hello, worlds!" , I want to see something along

View raw Solr tokens for a single field on a single document

喜你入骨 提交于 2019-12-01 02:12:56
问题 I'm debugging my Solr schema and I'd like to see the results of tokenizing a specific field. For a simplified example, if I have: <fieldType name="text" class="solr.TextField" omitNorms="false"> <analyzer> <tokenizer class="solr.StandardTokenizerFactory"/> <filter class="solr.StandardFilterFactory"/> <filter class="solr.LowerCaseFilterFactory"/> <filter class="solr.PorterStemFilterFactory"/> <filter class="solr.EdgeNGramFilterFactory" minGramSize="2" maxGramSize="15" side="front"/> </analyzer

Solr with Rails - rake sunspot:reindex is not working

旧时模样 提交于 2019-11-29 09:35:13
I am stuck into a strange issue where I am looking for your inputs. My problem is: After deploying my application on Production using Capistrano, when I am doing solr re-indexing, it is giving me below error: $ bundle exec rake sunspot:reindex --trace ** Invoke sunspot:reindex (first_time) ** Invoke environment (first_time) ** Execute environment ** Execute sunspot:reindex Skipping progress bar: for progress reporting, add gem 'progress_bar' to your Gemfile rake aborted! RSolr::Error::Http - 404 Not Found Error: Not Found Request Data: "<?xml version=\"1.0\" encoding=\"UTF-8\"?><delete>query

How to set Apache solr admin password

孤人 提交于 2019-11-27 18:49:23
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? ManojP 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> </web-resource-collection> <auth-constraint> <role-name>solr_admin</role-name> <role-name>admin</role