sunspot-solr

Solr will use Highlighter instead of FastVectorHighlighter warning

ε祈祈猫儿з 提交于 2019-12-13 04:48:07
问题 Hi I'm developing rails app with Solr 4.1 search engine, When I add highlighting to searchSolr start spaming the tomcat6 log with this warning: Jan 29, 2015 12:13:38 PM org.apache.solr.highlight.DefaultSolrHighlighter useFastVectorHighlighter WARNING: Solr will use Highlighter instead of FastVectorHighlighter because *Field_Name* field does not store TermPositions and TermOffsets. Example of my field in schema.xml: <field name="name" type="text" indexed="true" stored="true" multiValued="true"

Don't split on underscore with solr.StandardTokenizerFactory

醉酒当歌 提交于 2019-12-12 15:20:27
问题 I'm using solr, I'm using StandardTokenizerFactory in the text field but I don't want to split on the underscore. Do I have to use another toknizer like PatternTokenizerFactory or I can do this with StandardTokenizerFactory ? as I need the same functionality of StandardTokenizerFactory but without split on underscore. 回答1: I don't think you can do it in StandardTokenizerFactory. One solution is to first replace underscores with something the StandardTokenizerFactory won't process and

rails sunspot solr search by keywords

元气小坏坏 提交于 2019-12-11 19:14:02
问题 I am working around search for 2 days to query keyword search using sunspot solr . I am unable to understand My expected output is if i search for laptops in US it should search for laptop and us But the below code search only laptops and not the other words. How can i achieve it. My fulltext is working good I have edited schema.xml <fieldType name="text" class="solr.TextField" omitNorms="false"> <analyzer> <tokenizer class="solr.StandardTokenizerFactory"/> <filter class="solr

how to run sunspot reindex in background for every four hours

家住魔仙堡 提交于 2019-12-11 16:49:34
问题 I want to execute rake sunspot:reindex RAILS_ENV=production command for every four hours. To achieve this i have written simple bash script using shell programming. I will run successfully in terminal but if i tried to run it in crontab then it is not working. Operating system which am using is centos. Here is my bash script code #!/bin/bash #export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin export PATH=/usr/local/rvm/gems/ruby-1.9.2-p290/bin:/usr/local/rvm/gems/ruby-1

Reindex on sunspot rails

醉酒当歌 提交于 2019-12-11 12:55:04
问题 I have been trying to figure this out, but could not find the solution. Been trying all the suggestion from stackoverflow, but none works so far. I have setup the sunspot rails, and whenever i tried to reindex the database, its throwing me this error: rake sunspot:reindex Skipping progress bar: for progress reporting, add gem 'progress_bar' to your Gemfile rake aborted! RSolr::Error::Http: RSolr::Error::Http - 404 Not Found Error: NOT_FOUND URI: http://localhost:8982/solr/default/update?wt

Matching 2 out of 3 terms in Sunspot and WebSolr

笑着哭i 提交于 2019-12-11 07:57:25
问题 THe partial matching on my search is not working correctly. When I type in "Dublin Ireland" into my search then it correctly returns all the results in Dublin, Ireland. However, when I type "County Dublin Ireland" then it doesn't return any. I've set up an EdgeNGramFilter in my schmea.xml like so: <filter class="solr.EdgeNGramFilterFactory" minGramSize="1" maxGramSize="10"/> And I'm doing a fulltext search on the sunspot end on location: search_results = Events.solr_search do fulltext

Solr Strip html when highlighting with stored html fields

你离开我真会死。 提交于 2019-12-11 02:33:38
问题 Using Solr and Sunspot in rails. I am searching on an html field using a field type like this: <fieldType name="text_html" class="solr.TextField" omitNorms="false"> <analyzer> <tokenizer class="solr.StandardTokenizerFactory"/> <charFilter class="solr.HTMLStripCharFilterFactory"/> <filter class="solr.StandardFilterFactory"/> <filter class="solr.LowerCaseFilterFactory"/> <filter class="solr.ISOLatin1AccentFilterFactory"/> <filter class="solr.PorterStemFilterFactory"/> </analyzer> </fieldType> I

How to setup Solr Cloud with two search servers?

别来无恙 提交于 2019-12-10 18:50:49
问题 Hi I'm developing rails project with sunspot solr and configuring Solr Cloud. My environment: rails 3.2.1, ruby 2.1.2, sunspot 2.1.0, Solr 4.1.6. Why SolrCloud: I need more stable system - oftentimes search server goes on maintenance and web application stop working on production. So, I think about how to make 2 identical search servers instead of one, to make system more stable: if one server will be down, other will continue working. I cannot find any good turtorial with simple, easy to

Rails sunspot-solr - words with hyphen

爷,独闯天下 提交于 2019-12-07 13:59:57
问题 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

Sunspot Solr Search like Rails active record 'LIKE' search

烂漫一生 提交于 2019-12-07 05:21:45
问题 Hi I have been using the normal rails active record LIKE search in my app, I started using sunspot solr search. I would like it to act as close to the rails LIKE search as possible. wine.rb #sunspot stuff searchable :auto_index => true, :auto_remove => true do text :name end #sunspot stuff solr/conf/schema.xml <fieldType name="text" class="solr.TextField" omitNorms="false"> <analyzer> <tokenizer class="solr.StandardTokenizerFactory"/> <filter class="solr.StandardFilterFactory"/> <filter class