sphinx

Spinx search query with filtering

你说的曾经没有我的故事 提交于 2020-01-06 07:20:14
问题 I need to add additional filtering in Spinx query by post_category_name(String value) column, my current index: source min { type = mysql sql_host = localhost sql_user = root sql_pass = sql_db = test sql_query = select p.id, p.title, p.description, l.Latitude, l.Longitude FROM post p join location l on l.id = p.location_id // here I need filter by category name with post_id the same as // p.id in table post sql_attr_float = Latitude sql_attr_float = Longitude } I have 3 tables: post, location

Deep association and Sphinx index with Thinking Sphinx?

大憨熊 提交于 2020-01-04 16:01:06
问题 Currently I have the ff table: Teams id Team_User team_id, user_id Users user_id Item id team_id And the ff. model: Team has_and_belongs_to_many :users User has_and_belongs_to_many :teams Item belongs_to :audit_team, :class_name => "Team", :foreign_key => "team_id" Why I am trying to archive is to get Sphinx to index all the user_id that associate with Item and I came up with this index definition: define_index do has audit_team.users(id), :as => :team_users end I am not sure if this is

Deep association and Sphinx index with Thinking Sphinx?

我与影子孤独终老i 提交于 2020-01-04 16:00:50
问题 Currently I have the ff table: Teams id Team_User team_id, user_id Users user_id Item id team_id And the ff. model: Team has_and_belongs_to_many :users User has_and_belongs_to_many :teams Item belongs_to :audit_team, :class_name => "Team", :foreign_key => "team_id" Why I am trying to archive is to get Sphinx to index all the user_id that associate with Item and I came up with this index definition: define_index do has audit_team.users(id), :as => :team_users end I am not sure if this is

sphinxQL fetching random?

橙三吉。 提交于 2020-01-03 04:51:26
问题 In SphinxQL, how do I get random records from index? SELECT fname FROM indexname WHERE Age>=21 and Age<=47 random 0,4 \G; Getting following error: sphinxql: syntax error, unexpected CONST_INT, expecting BETWEEN (or 8 other tokens) near '0,4 Any other way to getting random record from SphinxQl? 回答1: All you need is ... ORDER BY RAND() LIMIT 4 来源: https://stackoverflow.com/questions/15434291/sphinxql-fetching-random

sphinxQL fetching random?

天大地大妈咪最大 提交于 2020-01-03 04:51:08
问题 In SphinxQL, how do I get random records from index? SELECT fname FROM indexname WHERE Age>=21 and Age<=47 random 0,4 \G; Getting following error: sphinxql: syntax error, unexpected CONST_INT, expecting BETWEEN (or 8 other tokens) near '0,4 Any other way to getting random record from SphinxQl? 回答1: All you need is ... ORDER BY RAND() LIMIT 4 来源: https://stackoverflow.com/questions/15434291/sphinxql-fetching-random

How to escape special characters in sphinxQL fulltext search?

假装没事ソ 提交于 2020-01-03 01:54:06
问题 in the sphinx changelog it says for 0.9.8: "added query escaping support to query language, and EscapeString() API call" can i assume, that there should be support for escaping special sphinx characters (@, !, -, ...) for sphinxQL, too? if so, maybe someone could point me to an example on this. i'm unable to find anything about it in the documentation or elsewhere on the net. how do you do fulltext search (using spinxQL), if the search-phrase contains one of the special characters? i don't

Sphinx returning bad search results

为君一笑 提交于 2020-01-02 04:04:10
问题 I am using Sphinx with the Thinking Sphinx plugin. I have indexed a model called Venue with the following code (and the rake thinking_sphinx:index command) define_index do indexes :name indexes city indexes zip end I obtain the results in my controller with this code: @venues = Venue.search params[:search] and I render them as json. The problem I have is that when I hit this URL: http://localhost:3000/venue/list?search=Baltimo I get nothing. But when I hit this URL: http://localhost:3000

Sphinx and “did you mean … ?” suggestions idea. WIll it work?

廉价感情. 提交于 2019-12-30 19:00:28
问题 I'm trying to come up with the fastest way to make search suggestions. At first I thought a Levenstein UDF function combined with a mysql table would do the job. But using levenshtein, mysql would have to go over every row in the table (tons of words) which would make the query really slow. Now I recently installed and started to use Sphinx (http://sphinxsearch.com/) for fulltext searching mainly because of its performance and tight mysql integration with SphinxSE. So I asked myself if I can

Guide to using Sphinx with PHP and MySQL

老子叫甜甜 提交于 2019-12-29 10:49:05
问题 I'm looking for a complete guide to using Sphinx with PHP and MySQL. I'd like one that's a bit simpler and easygoing than the one provided on the site. I'm looking for a few concepts on how exactly it all works. I have a server with PHP, HTML, other data and a MySQL database. How would I go about setting up Sphinx to power the search and results being returned? I'd like to be able to pass my search terms to my PHP script and have it deal with Sphinx and return the data. P.S. I'm also open to

SQL - Give me 3 hits for each type only

非 Y 不嫁゛ 提交于 2019-12-28 13:35:35
问题 I have some kind of impossible request :). I have a table where one of the columns is named type . I would like to SELECT 3 records for each type in that column. Is that possible? Note also that I'm using MySQL and Sphinx. UPDATE: Table structure id title type 1 AAAA string1 2 CCCC string2 3 EEEE string2 4 DDDD string2 5 FFFF string2 6 BBBB string2 6 BBBB string2 What I want my MySQL to return is (up to 3 records for each type ordered by title): id title type 1 AAAA string1 6 BBBB string2 2