background preloader


Facebook Twitter

Searching § Thinking Sphinx. Edit via Gyoza Basic Searching Once you’ve got an index set up on your model, and have the Sphinx daemon running, then you can start to search, using a method on your model named just that.

Searching § Thinking Sphinx 'pancakes' Sphinx does have some reserved characters (including the @ character), so you may need to escape your query terms. Riddle (a dependency of Thinking Sphinx) has escaping methods built-in: # For Thinking Sphinx v3 or Riddle::Query.escape(params[:query])# For Thinking Sphinx before Riddle.escape(params[:query]) Please note that Sphinx paginates search results, and the default page size is 20. Field Conditions To focus a query on a specific field, you can use the :conditions option - much like in ActiveRecord (back before Rails 3, anyway): :conditions => {:subject => 'pancakes'} You can combine both field-specific queries and generic queries too: 'pancakes', :conditions => {:subject => 'tasty'} Attribute Filters :bm25.

A Concise Guide to Using Thinking Sphinx : Freelancing Gods. Okay, it’s well past time for the companion piece to my Sphinx Primer – let’s go through the basic process of using Thinking Sphinx with Rails. Just to recap: Sphinx is a search engine that indexes data, and then you can query it with search terms to find out which documents are relevant. Why do you want to use it with Rails? Because it saves having to write messy SQL, and it’s so damn fast. (If you’re getting a feeling of deja-vu, then it’s probably because you’ve read an old post on this blog that dealt with an old version of Thinking Sphinx.

I’ve had a few requests for an updated article, so this is it.) Installation. Deploying a Rails app with Thinking Sphinx. For the past few years I’ve been working with Stephen P.

Deploying a Rails app with Thinking Sphinx

Anderson on a few things. The Mental Notes card deck is a brainstorming tool. “Each card describes one insight into human behavior and suggests ways to apply this to the design of Web sites, Web apps, and software applications.” In addition to those, we’ve launched a few sites for a client. After The Meeting is a site that helps you focus on what typically happens not during a meeting, but after. Part of After the Meeting is a way to make a formal agreement with someone. Slash Dot Dash » Blog Archive » Rails searching with Sphinx. Over the weekend I was implementing search for using Sphinx, the nginx of the search world (fast and Russian) according to Evan Weaver.

Slash Dot Dash » Blog Archive » Rails searching with Sphinx

Previously I was using Ferret, but I had to remove the search feature almost immediately due to the ferret indexes constantly corrupting and causing me a major headache. I decided to drop ferret in favour of Sphinx which I’ve lots of good things about recently. Installation on my MacBook Pro required a slight adjustment of the mysql directories with mysql5 from MacPorts. $ wget $ tar xvzf sphinx-0.9.7.tar.gz $ cd sphinx-0.9.7 $ . /configure --with-mysql-includes=/opt/local/include/mysql5/mysql/ --with-mysql-libs=/opt/local/lib/mysql5/mysql/ $ make $ sudo make install Initally, I chose to use Evan’s UltraSphinx plugin and it was very helpful to start with by auto-generating the sphinx.conf.

Using Sphinx search engine in Ruby on Rails. Almost all Web-applications needs data search logic and really often this logic should have full-text search capabilities.

Using Sphinx search engine in Ruby on Rails

If you are using MySQL database, you can use its FULLTEXT search, but it’s not efficient when you have a large amout of data. In this case third party search engines used, and one of them (and I think, the most efficient) is Sphinx. In this article I’ll present my port of Sphinx client library for Ruby and show how to use it. First of all, what is the Sphinx itself? Sphinx is a full-text search engine, meant to provide fast, size-efficient and relevant fulltext search functions to other applications. Sphinx - Free open-source SQL full-text search engine.