sphinx

Mixed MySQL and Sphinx queries

送分小仙女□ 提交于 2019-12-12 05:25:12
问题 I have MySQL and Sphinx installed and working properly on a LNMP server. Now I'd like to integrate a Sphinx sub-query into an existing MySQL query. Example: SELECT * FROM mysql_table JOIN (SELECT id FROM sphinx_index MATCH ('keyword')) AS match_table ON match_table.id = mysql_table.id Is this possible? If not, should I do the Sphinx separately and then use WHERE IN in the MySQL query, or will this kill the extra efficiency I'm getting from Sphinx? 回答1: Use SphinxSE http://sphinxsearch.com

Use exact search with OR operator inside Sphinx query

懵懂的女人 提交于 2019-12-12 03:55:24
问题 There are different search options possible with sphinx extended syntax. Exact search: "I love to eat" //will match exact phrase OR search: (eat|sleep|dream) Is it possible to mix them and build queries like that: "I love to (eat|sleep|dream)" I know it is possible to simplify it and split OR condition to different exact phrases, like: "I love to eat" | "I love to sleep" | "I love to dream" But I plan to use lot of OR groups with lot of options inside, and extending this query will end up

How to match rows with one or more words in query, but without any words not in query?

混江龙づ霸主 提交于 2019-12-12 03:15:15
问题 I have a table in a MySQL database that has a list of comma separated tags in it. I want users to be able to enter a list of comma separated tags and then use Sphinx or MySQL to select rows that have at least one of the tags in the query but not any tags the query doesn't have . The query can have additional tags that are not in the rows, but the rows should not be matched if they have tags not in the query. I either want to use Sphinx or MySQL to do the searching. Here's an example:

Thinking sphinx search returns nothing when multiple index files used on a single model

谁说胖子不能爱 提交于 2019-12-12 02:24:57
问题 Searching sometimes yields no results when my sphinx indices are separated into multiple files in one model. The versions I'm using: Rails - 4.1 Thinking Sphinx - 3.0.6 Sphinx - 2.0.9 I have five indices on this model: ThinkingSphinx::Index.define :incident, name: "incident_index_1" ... do indexes name end ThinkingSphinx::Index.define :incident, name: "incident_index_5" ... do indexes tags.name, as: :tag indexes custom_fields_values.value, as: :custom end Searching separately, the queries

PHP- Convert negative time-stamp to positive

我是研究僧i 提交于 2019-12-12 02:22:38
问题 I stored "date of birth" in Sphinx search engine as timestamp (integer) (eg) User DOB is "12-01-1960" (Age is 55) Sphinx side: 3980298496 (MySQL handle this from DB to Sphinx) In PHP side, For search purpose, I want to calculate time-stamp as follows but it gives negative value because PHP gives negative value if date is less than Jan 1 1970 Carbon::now()->subYears('55')->timestamp = -288316800 How do I make a positive time-stamp? so that I can do filter search from PHP. Or please suggest any

How to see what Sphinx is actually finding?

无人久伴 提交于 2019-12-12 02:12:25
问题 I am getting unexpected results from a sphinxql query from a very large database and a very complex configuration file. I'm stumped trying to figure out what i'd be getting these results. Is there anyway to return the result and simultaneously find the actual indexed data it found? I'm trying to get some insight/clue into what part of this complex configuration file to look into as line by line is e near impossibility. 回答1: As well as SHOW META , which itself shows much useful info... SHOW

ERROR: index 'products': too many string attributes (current index format allows up to 4 GB)

本小妞迷上赌 提交于 2019-12-12 01:27:54
问题 Got this when tried to index table in database with 25GB of data. Sphinx contains index declaration with following fields: sql_field_string = field_indexer #some keywords sql_field_string = product_name sql_field_string = description sql_attr_float = price sql_field_string = product_url sql_field_string = image_url sql_field_string = sku sql_attr_uint = merchant_id sql_attr_uint = network_id All of them must be indexed. How solve this problem? Multiple indexes or distributed indexes are

Sphinx multi value attribute filter

拟墨画扇 提交于 2019-12-11 23:45:44
问题 Yes, each tag has unique Id. It is not necessary that I have to store these unique id's in a table. I can store them in this way… $tags = array("Music","Sports","Food","Books",………) Array is the best way for me as it is easily alterable. Moreover the array keys itself will serve as the unique Id's. But my situation is more critical, so let me elaborate the exact situation. I have a single table with fields like Id, Title, Description, Tags, etc. etc. etc. Id | Title | Description | Tags 1 |

Sphinx Search Multiple Tables and Aggregate Results Using PHP API

梦想的初衷 提交于 2019-12-11 19:52:49
问题 I am trying to search several MySQL tables with different fields using Sphinx and combine all of the results into a single set based on relevance. I have configured Sphinx with an index for each table and am successfully combining the results by searching all of the indexes at once. When I query using SEARCH through the shell I get all of the result information back as expected. However, when I use the PHP API the result comes back only with the IDs of the rows and therefore no way to tell

Sphinx insert seems truncated but no errors found

北城余情 提交于 2019-12-11 17:14:47
问题 I have a Sphinx-configuration where I can't succeed to insert some contents of documents. I have a string of almost 6MB, which I can't insert completely. I tested this by querying back the inserted value and I get back only a part of the entire content. Lets say around 0.8MB. The configuration of Sphinx: index RTTest { type = rt path = /mnt/data001/RTTest rt_field = Name rt_field = Extension rt_field = Content rt_field = Tags rt_attr_uint = Reference rt_attr_uint = FileSize rt_attr_uint =