sphinx

Sphinx Search Index

ε祈祈猫儿з 提交于 2019-12-06 16:04:54
I'm having an issue with a Sphinx Search Index. I keep getting empty result sets from it. source mrc { type = mysql sql_host = localhost sql_user = root sql_pass = sql_db = test_db sql_port = 3306 mysql_connect_flags = 32 sql_query_pre = SET NAMES latin1 sql_query_pre = SET SESSION query_cache_type=OFF sql_query_pre = REPLACE INTO sphinx.indexer (idx,server,version,lastrun_at) SELECT 'mrc','localhost','2.0.4',UNIX_TIMESTAMP(NOW()) FROM DUAL sql_query_post = UPDATE sphinx.indexer SET fetched_by = UNIX_TIMESTAMP(NOW()) WHERE idx = 'mrc' AND server = 'localhost' AND version = '2.0.4' sql_query

how to get all column value from sphinx by configuration file php

放肆的年华 提交于 2019-12-06 14:53:25
i want to know how to get all column value from table using sphinx search... i have configuration file, that file can get only one field from table. but i need all field value. where will i modify for getting all field from table. thanks and advance... Sphinx will only return the document id, weight and attributes. Use MySQL to get the rest of the values. Do a Sphinx search, which will give you a list of document IDs For every document ID, do a MySQL query which gives you the values for all fields. I think there are some tricks could be used for the problem. if the column is not included in

Is there any hash function in PostgreSQL?

谁说我不能喝 提交于 2019-12-06 14:25:24
I am using Sphinx to index my database. The problem is I have to filter the result by a character varying field. So I have to find a way to convert character varying to sql_attr_uint . I know that CRC32 in mysql can do the trick. Is there a CRC32 or any replacement in PostgreSQL? Maybe you can use decode(substring(md5('foo') for 8), 'hex') . This would get you bytea of first 4 bytes of md5 hash of this string. You can convert it to integer using something like: create function bytea_to_integer(bytea) returns integer strict language sql as $$ select (get_byte($1,0)*1::integer<<0*8) +(get_byte(

How do I geo-search multiple models with ThinkingSphinx?

前提是你 提交于 2019-12-06 14:18:15
问题 I have two models indexed for searching (User and Item). I'm trying to do a geo-search across models: ThinkingSphinx::Search.search('keywords', :geo => [ degrees_to_radians(params[:lat].to_f), degrees_to_radians(params[:lon].to_f) ], ) But I only get an error: Sphinx Error: index item_core,item_delta,user_core,user_delta: unknown latitude attribute '' Searching each model individually works fine... but I've no idea what the problem here is. Here are the indexes: User Index: define_index do

Sphinx 2.0.4 Install Error with MAMP 2.0: Can't Find MySQL Headers

那年仲夏 提交于 2019-12-06 13:58:04
问题 Developing locally in MAMP and need Sphinx to work with MAMP's MySQL. Basically hitting a dead end during $ sudo make . MAMP installs without some necessary resources for Sphinx integration, mainly a mysql lib directory and an include directory filled with C header source files. These were downloaded and installed successfully (using CMake) into the following directories: /Applications/MAMP/Library/include/mysql /Applications/MAMP/Library/lib/mysql After unzipping Sphinx and running: sudo .

Sphinx with metaphone and wildcard search

送分小仙女□ 提交于 2019-12-06 12:52:17
we are an anatomy platform and use sphinx for our search. We want to make our search more fuzzier and started to use metaphone to correct spelling mistakes. It finds for example phalanges even though the search word is falanges . That's good but we want more. We want that the user could type in falange or even falang and we still find phalanges . Any ideas how to accomplish this? If you are interested you can checkout our sphinx config file here . Thanks! Well you can enable both metaphone and min_prefix_len on an index at once. It will sort of work. falange* might then just work. (to match

Using crc32 tweak on has_many relations in Thinking Sphinx

萝らか妹 提交于 2019-12-06 12:06:46
It's weird actually. I have two models that have has_many relation each other, here are my models #model city class City < ActiveRecord::Base belong_to :state end #model state class State < ActiveRecord::Base has_many :city end and I have state index ThinkingSphinx::Index.define 'state', :with => :active_record do indexes state_name, :sortable => true #here is the problem has "CRC32(cities.city_name)", :as => :city_name, :type => :integer end I want to use city_name as a filter. My code above doesn't work and i got an error message when run rake ts:index here is the error message ERROR: index

Sphinx Search / MySQL find most common words

三世轮回 提交于 2019-12-06 10:21:52
问题 I have a sphinx search index and would like to find what are the most common words in my index. Ideally have a list of words ordered by frequency. If it is not possible to do it using Sphinx, is there a way to query a mysql table's text fields to get the same stat? 回答1: Yes. This is quite simple. Build them with indexer using the --buildstops and --buildfreqs flags. indexer --config /path/to/sphinx.conf indexName --buildfreqs --buildstops freq_wordlist.txt 100000 This example gives you the

Searching a particular index using Sphinx, from multiple indexes, through PHP script

自闭症网瘾萝莉.ら 提交于 2019-12-06 07:40:34
I have multiple sources, like this (say) source src1{ ... } source src2{ ... } AND index src1{ ... } index src2{ ... } src1 has sql query from one individual table and src2 has sql query based on another individual table. Now, in the PHP script, how do I specify, which indexer to use? Normally, in the PHP script, we write it this way $ss = new SphinxClient; $ss->setServer("localhost", 9312); $ss->setMatchMode(SPH_MATCH_ANY); Since, there is no mention about the indexer being used. It's useless to search both indexes (i.e., both tables). I want to search the index src2(say) i.e., data from the

Location of sphinx-build on CentOS

别等时光非礼了梦想. 提交于 2019-12-06 07:36:19
I have a brand new CentOS 6 box and wanted to install sphinx, in order to compile documents as generated by readthedocs.org i.e. rst files. In a previous ubuntu box I was running make html and that would invoke the sphinx-build command and compile the documentation. I downloaded the latest version of sphinx and installed it as such: sudo wget http://sphinxsearch.com/files/sphinx-2.1.9-1.rhel6.x86_64.rpm sudo localinstall sphinx-2.1.9-1.rhel6.x86_64.rpm Everything seems to be fine but sphinx-build is nowhere to be found. Any pointers are more than appreciated. You are mixing up two different