sphinx

Ordering items with matching tags by number of tags that match

只愿长相守 提交于 2019-12-04 08:32:58
问题 I'm trying to figure out how to order items with matching tags by the number of tags that match. Let's say you have three MySQL tables: tags(tag_id, title) articles(article_id, some_text) articles_tags(tag_id, article_id) Now let's say you have four articles where: article_id = 1 has tags "humor," "funny," and "hilarious." article_id = 2 has tags "funny," "silly," and "goofy." article_id = 3 has tags "funny," "silly," and "goofy." article_id = 4 has the tag "completely serious." You need to

开源中文检索软件CoreSeek之初体验

守給你的承諾、 提交于 2019-12-04 08:10:49
国人开发的CoreSeek实际是上基于Sphinx的定制版,使用mmseg进行中文分词并实现中文搜索。 官网提供了详细的安装说明和 CentOS5 的rpm安装包,由于笔者需要在CentOS 6 x86_64上运行,得自行打包。笔者已完成源码包的封装: mmseg 、 coreseek 。 相对 Sphinx的安装 ,CoreSeek需要安装中文分词库mmseg。测试方法就是在示例数据库里插入一些中文字符串: 然后重建索引就可以自动分词,并查询中文了: 特别需要注意的就是,要统一字符编码。笔者统一使用UTF-8,示例MySQL数据库对应表的属性是: CREATE TABLE `documents` ( `id` int(11) NOT NULL AUTO_INCREMENT, `group_id` int(11) NOT NULL, `group_id2` int(11) NOT NULL, `date_added` datetime NOT NULL, `title` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `content` text COLLATE utf8_unicode_ci NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT

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

走远了吗. 提交于 2019-12-03 23:32:48
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 = "%$friendSearch%"; $query = "SELECT f.fid, u.uname FROM friends f JOIN users u ON f.fid=u.uid WHERE f.uid=

Mac 10.8 下安装Sphinx并支持生成中文PDF

徘徊边缘 提交于 2019-12-03 21:11:14
Mac 10.8 下安装Sphinx并支持生成中文PDF 最近一直在用Sphinx撰写文档,但是生成中文PDF时老是失败。今天在网上查了些资料,终于把它弄成功了。现记录如下。 需要用到的软件有: python 2.7 Sphinx 1.2 MacTex 2013 安装Sphinx $ sudo easy_install-2.7 Sphinx 安装MacTex 请到 http://www.tug.org/mactex/ 下载,或 点此 下载。安装过程就略了。 让Sphinx latex支持中文 首先使用 sphinx-quickstart 生成Sphinx项目。然后修改 conf.py 文件。将如下段: latex_elements = { # The paper size ('letterpaper' or 'a4paper'). #'papersize': 'letterpaper', # The font size ('10pt', '11pt' or '12pt'). #'pointsize': '10pt', # Additional stuff for the LaTeX preamble. #'preamble': '', } 替换成: latex_elements = { # The paper size ('letterpaper' or 'a4paper').

Does Sphinx auto update is index when you add data to your SQL?

喜欢而已 提交于 2019-12-03 20:17:50
I am curious as to whether or not Sphinx will auto update its index when you add new SQL data or whether you have to tell it specifically to reindex your db. If it doesn't, does anyone have an example of how to automate this process when the database data changes? As found in the sphinx documentation part about real-time indexes Real-time indexes (or RT indexes for brevity) are a new backend that lets you insert, update, or delete documents (rows) on the fly. So to update an index on the fly you would just need to make a query like {INSERT | REPLACE} INTO index [(column, ...)] VALUES (value, .

Thinking sphinx doesn't start - “Failed to start searchd daemon”

拟墨画扇 提交于 2019-12-03 14:08:49
I try to start thinking sphinx on my server but it doesn't want to work. I do: $ rake thinking_sphinx:index && rake thinking_sphinx:start And i get: Generating Configuration to /vol/www/apps/ror_tutorial/releases/20120202111730/config/development.sphinx.conf Sphinx 2.0.3-release (r3043) Copyright (c) 2001-2011, Andrew Aksyonoff Copyright (c) 2008-2011, Sphinx Technologies Inc (http://sphinxsearch.com) using config file '/vol/www/apps/ror_tutorial/releases/20120202111730/config/development.sphinx.conf'... indexing index 'micropost_core'... WARNING: collect_hits: mem_limit=0 kb too low,

How do I add the condition “IS NOT NULL” to a Thinking Sphinx search

[亡魂溺海] 提交于 2019-12-03 13:04:55
I'm using Thinking Sphinx for full-text search, following this video . I'd like to do the following: @articles = Article.search(params[:search], :conditions => "published_at IS NOT NULL", :order => :created_at) The problem is that this doesn't work. It seems that the search method only accepts conditions that are a hash. I've tried a couple of ways, but I am clueless as to how I can represent "published_at IS NOT NULL" as a hash... Was given the solution over at Railscasts If you want *all* results for that model to filter out records where published_at IS NULL, add 'where "published_at IS NOT

Any ideas why Thinking Sphinx Rake tasks are not running?

﹥>﹥吖頭↗ 提交于 2019-12-03 12:50:10
I'm finding that Thinking Sphinx sometimes errors out when I try to run its Rake tasks. Sometimes the tasks work fine, and sometimes I get errors like the one below. I'm running the tasks as a normal user, not root. Not using sudo. In the example below, searchd is still running after the Rake task fails. I've also seen similar errors with ts:rebuild . Has anyone else seen this? I'm using Sphinx 0.9.9-release (r2117) I'm using Thinking Sphinx 1.4.4 instead of the latest version because I'm on Rails 2.3.11. $ rake ts:stop RAILS_ENV=production (in /var/www/blog_app/releases/20110425053509) rake

Sphinx autodoc dies on ImportError of third party package

匿名 (未验证) 提交于 2019-12-03 10:24:21
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: There's any way to exclude the import part of a module and then document it with sphinx-python? I have a module that imports another package (other different project) and then the sphinx gives this error: """ File "/usr/local/lib/python2.7/dist-packages/Sphinx-1.1.3-py2.7.egg/sphinx/ext/autodoc.py", line 321, in import_object import (self.modname) File "/home/x/GitHub/project/mod_example1.py", line 33, in from other_pck import Klass, KlassStuff ImportError: No module named other_pck """ And if I comment the import parts in the

sphinx-build fail - autodoc can't import/find module

匿名 (未验证) 提交于 2019-12-03 10:24:21
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm trying to get started with Sphinx and seem to have relentless problems. Command: docs/sphinx-quickstart I answer all the questions and everything works fine. Command: docs/ls Everything looks normal. Result: build Makefile source Command: sphinx-build -d build/doctrees source build/html It seems to work. I was able to open the index.html file and see a "shell" of what I'm wanting. When I try and put my actual source code as the source folder I run into problems. Command: sphinx-build -d build/doctrees ../ys_utils build/html Result: