thinking-sphinx

Get max and min value of a column with thinking sphinx

半城伤御伤魂 提交于 2019-12-12 00:43:23
问题 I'm working with Rails and thinking sphinx. I have a model Product indexed as following (only showing relevant information) define_index do indexes :name, :as => :name, :sortable => true indexes color, :facet => true ... indexes price, :as => :range, :facet => true has created_at, price, root_category_id ... end What I need is to get the Product with max price of the current search. I've tried something like Product.search('', :select => 'MAX(price)') but it's returning me a mess. >> Product

ThinkingSphinx returning empty result in console

风流意气都作罢 提交于 2019-12-11 19:16:36
问题 I am having the same problem that is brought up here: thinking sphinx and console (Tried to ask a question on that thread but can't...) Basically, any search done in the console returns an empty result. However, if I do the search through the site it works fine. But are in development mode on my local machine. (OS X) Example: > Article.search 'eating' [] That same search in a browser returns the expecting results. I have rebuild the indexes numerous times. Killed off ThinkingSphinx and

Conditional “or” in Thinking Sphinx search

那年仲夏 提交于 2019-12-11 13:28:22
问题 Using RoR 2.3.8. Here's my controller code: class CitiesController < ApplicationController def show @city = City.find(params[:id]) @shops = Shop.search @city.name, { :conditions => {:country => @city.country && (:city => @city.name || :state => @city.state)}, :page => params[:page], :per_page => 100 } end end The :conditions => {:country => @city.country && (:city => @city.name || :state => @city.state)} obviously doesn't work because I am just trying to explain what I wanna achieve. :city

sphinx search for partial keyword matches

[亡魂溺海] 提交于 2019-12-11 09:59:13
问题 Ruby on Rails -> ThinkingSphinx -> SphinxSearch -> Mysql I want to search the titles table. The expected user keyword will not be an exact match, it will be a partial match. search_key = "android samsung galaxy ace black phones" Searching against the titles table, titles(table) id | titles 1 | nokia c6 2 | samsung galaxy ace 3 | samsung galaxy ace y 4 | nokia lumia 800 5 | samsung monte 6 | samsung galaxy note case - 1 : Title.search search_key, :match_mode => :all =>No results Comment: Bad

Indexing for Sphinx of legacy data generating some errors

可紊 提交于 2019-12-11 09:59:04
问题 A rails 3.2.18 application is being created, migrating data from a rails 2.3.10 application. Data is being ported over via pg_dump and loaded via psql command, without any errors. One model of the 13 that are indexed via thinking_sphinx is getting some errors. Only 1 in 8.5 docs is being indexed overall. indexing index 'norm_core'... ERROR: index 'norm_core': sql_range_query: ERROR: integer out of range (DSN=pgsql://jerdvo:***@localhost:5432/fna_development). total 1019 docs, 234688 bytes The

Thinking Sphinx unknown identifier groupby

瘦欲@ 提交于 2019-12-11 09:25:59
问题 I am trying to use Thinking Sphinx search with group_by option according to documentation http://pat.github.io/thinking-sphinx/searching.html#grouping : Point.search('point', group_by: :tour_id) But this code generates incorrect Sphinx Query SELECT *, groupby() as sphinx_internal_group, count(*) as sphinx_internal_count FROM `point_core`, `point_delta` WHERE MATCH('point') AND `sphinx_deleted` = 0 GROUP BY `tour_id` LIMIT 0, 20 which raises error: ThinkingSphinx::ParseError: index point_core

Thinking Sphinx and negative IDs

依然范特西╮ 提交于 2019-12-11 05:28:10
问题 I have a User model and a Message model where users can send messages to each other, and I use Thinking Sphinx gem for fulltext search as connector for Sphinx Search in Ruby on Rails. In my User model I use negative IDs for system users, positive IDs for regular users. Now I have the problem that Sphinx seems to ignore searches in messages by/to users with those negative IDs (=foreign key sender_id as has -Attribute). Index as definded in my Message model: define_index 'messages_index' do

How do I configure PostgreSQL or MySQL to set up a database with Sphinx?

筅森魡賤 提交于 2019-12-11 04:33:44
问题 I really need help installing Sphinx and getting it going. I'm on rails 3 and I'm following these set of directions: http://freelancing-god.github.com/ts/en/quickstart.html to install Sphinx. Thinking Sphinx was easy to install since it's a gem. However, the guide says I need to have both Sphinx and Thinking Sphinx installed to get started (Is this true?). I checked Ryan Bates' railscast for Thinking Sphinx and he only installed the plugin and got started immediately. Anyways, I installed

Rails 4.1 - thinking-sphinx association not working

旧时模样 提交于 2019-12-10 12:23:26
问题 I have a Rails app that contains two models, Post and User , I'm using Sphinx and the thinking-sphinx gem to enable search. Each post belongs to a user, with belongs_to , and each user can have many posts. When I search for posts I also want to be able to search by the user's name that have created the post. My index for Posts looks like this: ThinkingSphinx::Index.define :post, :with => :active_record do indexes name, :sortable => true indexes post_description indexes user.name, as: :post

Setting up thinking sphinx after server reboot (Rails project)

为君一笑 提交于 2019-12-10 12:16:33
问题 Problem: I am trying to get sphinx running again after server reboot. There seems to be no sphinx.conf file when I try to start it running: >searchd Sphinx 2.0.4-release (r3135) Copyright (c) 2001-2012, Andrew Aksyonoff Copyright (c) 2008-2012, Sphinx Technologies Inc (http://sphinxsearch.com) FATAL: no readable config file (looked in /etc/sphinxsearch/sphinx.conf, ./sphinx.conf). I have run: rake thinking_sphinx:configure rake thinking_sphinx:index rake thinking_sphinx:start The problem is