sphinx

Thinking Sphinx and acts_as_taggable_on plugin

孤人 提交于 2019-11-28 19:01:47
I installed Sphinx and Thinking Sphinx for ruby on rails 2.3.2. When I search without conditions search works ok. Now, what I'd like to do is filter by tags, so, as I'm using the acts_as_taggable_on plugin, my Announcement model looks like this: class Announcement < ActiveRecord::Base acts_as_taggable_on :tags,:category define_index do indexes title, :as => :title, :sortable => true indexes description, :as => :description, :sortable => true indexes tags.name, :as => :tags indexes category.name, :as => :category has category(:id), :as => :category_ids has tags(:id), :as => :tag_ids end For

分布式架构浅谈

╄→尐↘猪︶ㄣ 提交于 2019-11-28 10:56:48
http://homeway.me/ 0x01.大型网站演化 简单说,分布式是以缩短单个任务的执行时间来提升效率的,而集群则是通过提高单位时间内执行的任务数来提升效率。 集群主要分为:高可用集群(High Availability Cluster),负载均衡集群(Load Balance Cluster,nginx即可实现),科学计算集群(High Performance Computing Cluster)。 分布式是指将不同的业务分布在不同的地方;而集群指的是将几台服务器集中在一起,实现同一业务。分布式中的每一个节点,都可以做集群。 而集群并不一定就是分布式的。 之前在网上看到一篇关于大型网站演化的博客。 http://www.cnblogs.com/leefreeman/p/3993449.html 每个大型网站都会有不同的架构模式,而架构内容也就是在处理均衡负载,缓存,数据库,文件系统等,只是在不同的环境下,不同的条件下,架构的模型不一样,目的旨在提高网站的性能。 最初的架构只有应用程序,数据库,文件服务。 到后来,分布式服务、集群架设。 0x02.关于均衡负载方案 在上一篇, 《Nginx反向代理实现均衡负载》 讨论过过的nginx现实均衡负载方案,这里选择另一种HAProxy+Keepalived双机高可用均衡负载方案。 HAProxy是免费

Laravel: order by where in

♀尐吖头ヾ 提交于 2019-11-28 05:58:02
I am using SphinxSearch to query some contents and have the ids of my objects that I want to query with MySQL. The array of my ids are sorted depending on their rank Sphinx gives. Thus, I would like to make a MySQL like so: SELECT * FROM table WHERE id IN (1,17,2) ORDER BY FIELD(id,1,17,2) I know I can do: Table::whereIn('id', $ids)->get(); But I can't get the order I had. How can I do that in a proper way with Laravel ? Using the solution found on http://laravelsnippets.com/snippets/get-all-items-at-once-ordered-by-the-current-order-of-ids-in-the-where-in-clause-using-eloquent $ids = array(1

Best way to deal with misspellings in a MySQL fulltext search

放肆的年华 提交于 2019-11-27 21:35:44
问题 I have about 2000 rows in a mysql database. Each row is a max of 300 characters and contains a sentence or two. I use mysql's built in fulltext search to search these rows. I would like to add a feature so that typos and accidental mispellings are corrected, if possible. For example, if someone types "right shlder" into the searchbox, this would equate to "right shoulder" when performing the search. What are your suggestions on the simplest way to add this kind of functionality? Is it worth

Full Text Searching with Rails

只谈情不闲聊 提交于 2019-11-27 18:00:53
I've been looking into searching plugins/gems for Rails. Most of the articles compare Ferret (Lucene) to Ultrasphinx or possibly Thinking Sphinx, but none that talk about SearchLogic . Does anyone have any clues as to how that one compares? What do you use, and how does it perform? Gene T thinking_sphinx and sphinx work beautifully, no indexing, query, install problems ever (5 or 6 install, including production slicehost ) why doesn't everybody use sphinx, like, say craigslist? read here about its limitations (year and a half old articles. The sphinx developer, Aksyonoff, is working on these

Thinking Sphinx and acts_as_taggable_on plugin

。_饼干妹妹 提交于 2019-11-27 12:08:56
问题 I installed Sphinx and Thinking Sphinx for ruby on rails 2.3.2. When I search without conditions search works ok. Now, what I'd like to do is filter by tags, so, as I'm using the acts_as_taggable_on plugin, my Announcement model looks like this: class Announcement < ActiveRecord::Base acts_as_taggable_on :tags,:category define_index do indexes title, :as => :title, :sortable => true indexes description, :as => :description, :sortable => true indexes tags.name, :as => :tags indexes category

全文检索引擎sphinx 与 Elasticsearch 索引速度对比

↘锁芯ラ 提交于 2019-11-27 07:20:27
sphinx的特色之一是建立索引速度快,最近转投Elasticsearch后,一直想做个对比,网上资料常见说法是10倍的差距。 测试环境 硬件:单核,2G内存的E5-2630 虚拟机 操作系统:Centos 6.5 版本 sphinx 版本:coreseek 4.1(基于sphinx 2.02) Elasticsearch 版本:2.3.1 mysql 版本:5.6 分词器(均使用默认的分词词库) mmseg:coreseek自带 ik:Elasticsearch 插件 索引数据源 数据库:mysql 数据量:46万+篇文章,约为1.6G数据 建立索引的字段:id,title,content Elasticsearch 使用插件:Elasticsearch-jdbc 2.3.1 Elasticsearch 集群设置 为了尽可能接近单机测试,Elasticsearch 仅开启一个服务节点(本地),且索引不做分片,不做副本。 测试情况 sphinx 每秒处理数据量:2.77 MB 每秒处理文档数:1277 篇 截图-sphinx Elasticsearch 每秒处理数据量:0.794 MB 每秒处理文档数:397 篇 截图-Elasticsearch(kibana 监控) 测试结论 sphinx 索引速度确实相对比较快,可能是环境的差异,未达到官方所说的10M/s 的索引速度;

Goal driven performance optimization

泄露秘密 提交于 2019-11-27 05:07:29
When your goal is to optimize application performance it is very important to understand what goal do you really have. If you do not have a good understanding of the goal your performance optimization effort may well still bring its results but you may waste a lot of time before you reach same results as you would reach much sooner with focused approach. The time is critical for many performance optimization tasks not only because of labor associated expenses but also because of the suffering – slow web site means your marketing budget is wasted, customer not completing purchases, users are

Full Text Searching with Rails

荒凉一梦 提交于 2019-11-27 04:16:05
问题 I've been looking into searching plugins/gems for Rails. Most of the articles compare Ferret (Lucene) to Ultrasphinx or possibly Thinking Sphinx, but none that talk about SearchLogic. Does anyone have any clues as to how that one compares? What do you use, and how does it perform? 回答1: thinking_sphinx and sphinx work beautifully, no indexing, query, install problems ever (5 or 6 install, including production slicehost ) why doesn't everybody use sphinx, like, say craigslist? read here about

How to evaluate hosted full text search solutions?

爱⌒轻易说出口 提交于 2019-11-27 03:01:03
What are the options when it comes to SaaS/hosted full text search? How should I evaluate the different options available? I'm looking for something that uses Lucene, solr, or sphinx on the backend, and provides a REST API for submitting documents to index, and running searches. I could build my own EC2 AMI, but I'd have to configure EBS and other stuff, monitor it, etc. Websolr provides a cloud-based Solr with a control panel. It's in private beta as of this writing, but you can get the service through Heroku . Another hosted Solr service is PowCloud , also in private beta, which seems to