sphinx

sphinx全文检索之PHP使用教程

☆樱花仙子☆ 提交于 2019-12-10 13:57:41
这是半年前没有对外写的文章,现在拿出来分享下。可能会有一些不正确或不严谨的地方,某些语言可能比较轻浮,请见谅。 上一篇[ 查看 ]介绍了sphinx的基本安装、配置和使用,现在来看看如何应用在PHP上。 基础 以上一篇的email数据表为例: 数据结构: CREATE TABLE email ( emailid mediumint( 8 ) unsigned NOT NULL auto_increment COMMENT ' 邮件id ' , fromid int ( 10 ) unsigned NOT NULL default ' 0 ' COMMENT ' 发送人ID ' , toid int ( 10 ) unsigned NOT NULL default ' 0 ' COMMENT ' 收件人ID ' , content text unsigned NOT NULL COMMENT ' 邮件内容 ' , subject varchar ( 100 ) unsigned NOT NULL COMMENT ' 邮件标题 ' , sendtime int ( 10 ) NOT NULL COMMENT ' 发送时间 ' , attachment varchar ( 100 ) NOT NULL COMMENT ' 附件ID,以逗号分割 ' , PRIMARY KEY

Fuzzy Street Address Searches Using MySQL Fulltext (or sphinx?)

 ̄綄美尐妖づ 提交于 2019-12-10 13:16:21
问题 I have a database table full of addresses from Google Maps geocode responses. Google abbreviates all directions (West -> W, East -> E, etc). So if I enter an address like "100 West Pender Street" then the formatted address returned by Google Maps is "100 W Pender St" which I insert into my table. Now if a user comes along and searches for that address, all of the following should match: pender street west pender street 100 pender 100 w pender 100 west pender and they more or less do. the "w"

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

Sphinx Search mysql client on production server

随声附和 提交于 2019-12-10 12:14:49
问题 I want to connect to SphinxQL on my production server to execute sphinx queries on mysql database, Please note I ran the following commands in the production server terminal(Ubuntu 10.04) by connecting to it remotely. mysql -h 127.0.0.1 -P 9312 mysql -h 127.0.0.1 -P 9306 mysql -h <<my_production_ip_address>> -P 9312 mysql -h <<my_production_ip_address>> -P 9306 Tried changing the bind_address in /etc/mysql/my.cnf to my_production_ip_address. I want to run a sphinx query on my production

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

独自空忆成欢 提交于 2019-12-10 11:26:47
问题 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

Sphinx Daemon returned error: index product_core: INTERNAL ERROR: incoming-schema mismatch. Only on staging server

老子叫甜甜 提交于 2019-12-10 10:23:47
问题 The application is using Rails 2.3.12 and ThinkingSphinx 1.4.11 . There is only one index on Product model and it is working OK on devel box. After cap staging deploy I am generating config on the server, creating index, and starting daemon: bundle exec rake ts:conf RAILS_ENV=staging bundle exec rake ts:index RAILS_ENV=staging bundle exec rake ts:start RAILS_ENV=staging After going to rails console I'm getting: >> Product.search('music') Sphinx Sphinx Daemon returned error: index product_core

ElasticSearch VS. Solr VS. Sphinx:最好的开源搜索引擎比较

若如初见. 提交于 2019-12-10 07:17:15
译者按:本文是来自一家乌克兰技术公司的文章。该文章译者认为着重在应用上,而非单纯的性能对比。给自己的平台选择一个合适的搜索引擎比任何一个吹嘘技术强大的好。虽然最近一两年 ES发展飞速,但sphinx的简单易用性还是赢得很多机构公司的青睐,比如优酷土豆都是用sphinx。所以使用之前,务必先了解自己的业务诉求,再选择合适的搜索引擎,而非一昧跟风。翻译若有误请指正,谢谢查看! 编译自: ELASTICSEARCH VS. SOLR VS. SPHINX: BEST OPEN SOURCE SEARCH PLATFORM COMPARISON 作者:Anna Klimenko 从业务角度来看,您应该将高效的搜索引擎视为一种强大的工具,能够提高转换率并为网站所有者带来更多利润。如果您的网站搜索机制没有提供相关结果或搜索性能太低,用户将离开网站并转到其竞争对手。 那么,什么是高效的搜索引擎? 搜索的主要目的是检索与用户查询最相关的匹配,排除网站上的其他常规内容。 在当前搜索引擎中可以获得的功能中,最受欢迎的是: 全文搜索(通过简单的单词和短语或单词或短语的多种形式) 多字段搜索 高亮显示(在搜索框中输入的单词的高亮) 按同义词搜索 自动填充建议 [建议和突出显示 彭博 ] 多值属性搜索(原文: faceted search,译者改成多值属性或许会更准确 )(属性计数。例如

Sphinx search: charset table difficulties

自古美人都是妖i 提交于 2019-12-09 21:07:00
问题 I am loosing my mind on this for two days now... I would like to use slovenian letters in sphinx search, all english ones + č ž š (and just in case ć) I was looking all over the net to get the proper chars but I found squat... so I decided to make my own step by step... this is my index index classifieds { source = classifieds_src path = c:\Sphinx\data\classifieds docinfo = extern min_infix_len = 2 infix_fields = title,keywords,summary,text expand_keywords = 1 enable_star = 1 charset_type =

Sphinx vs. MySql - Search through list of friends (efficiency/speed)

天涯浪子 提交于 2019-12-09 14:49:36
问题 I'm porting my application searches over to Sphinx from MySQL and am having a hard time figuring this one out, or if it even needs to be ported at all (I really want to know if it's worth using sphinx for this specific case for efficiency/speed): users uid uname 1 alex 2 barry 3 david friends uid | fid 1 2 2 1 1 3 3 1 Details are: - InnoDB - users: index on uid, index on uname - friends: combined index on uid,fid Normally, to search all of alex's friends with mysql: $uid = 1 $searchstr = "%

Sphinx warning preload: failed to open

十年热恋 提交于 2019-12-08 19:18:05
问题 I installed sphinx search service. For creating indexes I use next command: sudo searchd -c /etc/sphinxsearch/sphinx.conf After get warning message in terminal: using config file '/etc/sphinxsearch/sphinx.conf'... listening on 127.0.0.1:3322 precaching index 'medicalfacilities' WARNING: index 'medicalfacilities': preload: failed to open /var/data/sphinx/medicalfacilities.sph: No such file or directory; NOT SERVING precaching index 'article_index' Also tried to stop sphinx: searchd --stop and