free open-source SQL full-text search engine

Need a hand?
+1-888-333-1345


Sphinx

Community

Services

Misc

 Subscribe in a reader

Tracked by ClickAider

News entry

Sep 07, 2007. 0.9.8 dev news: multi-query support

My talk on Sphinx had been accepted for Highload '2007 Russian conference. So over last couple of weeks I was suddenly busy not only with the usual development cycle but writing the talk as well (it had to be submitted early to get to print materials). The result looks like a nice article so I'm going to translate and post it here later; somewhere after the conference (very end of September, or early October).

Anyway, the work on Sphinx continued. This time I'm rolling out only one new feature, but it is pretty major one: multi-query support. Updated snapshot is available from Downloads section.

The most obvious benefit from using multi-query (ie. sending multiple search queries to Sphinx at once) is saving network connection overheads and other round-trip costs. But what's much more important, it unlocks possibilities to optimize “related” queries internally.

One typical Sphinx usage pattern is to return several different “views” on the search results. For instance, one might need to display per-category match counts along with product search results, or maybe a graph of matches over time. Yes, that could be easily done earlier using the grouping features. However, one had to run the same query multiple times, but with different settings.

From now on, if you submit such queries through newly added multi-query interface (as a side note, ye good olde Query() interface is not going anywhere, and compatibility with older clients should also be in place), Sphinx notices that the full-text search query is the same and it is just sorting/grouping settings which are different. In this case it only performs expensive full-text search once, but builds several different (differently sorted and/or grouped) result sets from retrieved matches. I've seen speedups of 1.5-2 times on my simple synthetic queries; depending on different factors, the speedup could be even greater in practice.

Permalink // del.icio.us // digg // stumble

Add comment

Name and Comment are required; other fields are optional. Email will never be displayed nor transferred nor used for anything else except getting back in touch. Register and then login to skip spambot check and filling your name every time. Sorry, no markup at all for now.

Name (*)
Email
Website
Comment (*)
8 + 5 = ?
 


Copyright © Sphinx Technologies Inc, 2009