# \[ANN\] Sphincter 1.0.0 Released

**URL:** <https://www.ruby-forum.com/t/ann-sphincter-1-0-0-released/110792>\
**Category:** Rails\
**Created:** [July 31, 2007, 12:21am UTC](https://www.ruby-forum.com/t/ann-sphincter-1-0-0-released/110792 "2007-07-31T00:21:08Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![miracleofmagick](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/71c47a/32.png) [@miracleofmagick](https://www.ruby-forum.com/u/miracleofmagick)\
**Post date:** [July 31, 2007, 12:21am UTC](https://www.ruby-forum.com/t/ann-sphincter-1-0-0-released/110792/1 "2007-07-31T00:21:08Z")

</div>

Sphincter version 1.0.0 has been released!

[http://seattlerb.org/Sphincter](http://seattlerb.org/Sphincter)

Sphincter uses Dmytro Shteflyuk’s sphinx Ruby API and automatic  
configuration to make totally rad ActiveRecord searching. Well, you  
still have to tell Sphincter what models you want to search. It  
doesn’t read your mind.

Features:

- Automatically configures itself.
- Handy set of rake tasks for easy, automatic management.
- Automatically adds has\_many metadata for searching across the  
association.
- Stub for testing without connecting to searchd, Sphincter::SearchStub.
- Easy pagination support.
- Filtering by index metadata and ranges, including dates.

Problems:

- Setting match mode not supported.
- Setting sort mode not supported.
- Setting per-field weights not supported.
- Setting id range not supported.
- Setting group-by not supported.

See README.txt for quick-start, examples, etc.

Changes:

## 1.0.0 / 2007-07-26

- 1 major enhancement
  - Birthday!

[http://seattlerb.org/Sphincter](http://seattlerb.org/Sphincter)

–  
Poor workers blame their tools. Good workers build better tools. The  
best workers get their tools to do the work for them. – Syndicate Wars

---

<div class="post-metadata">

**Author:** ![miracleofmagick](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/71c47a/32.png) [@miracleofmagick](https://www.ruby-forum.com/u/miracleofmagick)\
**Post date:** [July 31, 2007, 7:35am UTC](https://www.ruby-forum.com/t/ann-sphincter-1-0-0-released/110792/2 "2007-07-31T07:35:35Z")

</div>

Hey Eric,

Looks pretty awesome. Can you tell me the main differences beteween  
this and say the acts\_as\_sphinx plugin? We’ll be looking into  
implementing site search in the coming months and I’m fairly sure I  
want to use Sphinx (awesome stuff).

---

<div class="post-metadata">

**Author:** ![miracleofmagick](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/71c47a/32.png) [@miracleofmagick](https://www.ruby-forum.com/u/miracleofmagick)\
**Post date:** [July 31, 2007, 9:54am UTC](https://www.ruby-forum.com/t/ann-sphincter-1-0-0-released/110792/3 "2007-07-31T09:54:56Z")

</div>

On Jul 30, 2007, at 22:34, Marston A. wrote:

> Hey Eric,
> 
> Looks pretty awesome. Can you tell me the main differences beteween  
> this and say the acts\_as\_sphinx plugin? We’ll be looking into  
> implementing site search in the coming months and I’m fairly sure I  
> want to use Sphinx (awesome stuff).

I set out to write something that would take away as much of my work  
as possible, and I left out anything I didn’t need. Some people  
might want those things and I designed it to be easy for most people  
to add them (and tested it to make sure). I picked what I thought  
were sensible defaults for configuration options and automated it as  
much as possible.

acts\_as\_sphinx does much less than Sphincter, which means you have to  
do more.

With acts\_as\_sphinx:

- You have to write the configuration file by hand.
- You have to build the source queries by hand.
- You don’t get easy searches via associations like  
my\_blog.posts.search for free.
- You’re hard-coded to /var/run, which probably won’t work for VPS/  
slice setups.
- You need a separate running sphinx daemon to test searching.
- You don’t have any test coverage (but acts\_as\_sphinx is tiny, with  
164 lines of code.)

With acts\_as\_sphinx, you probably get some of these that Sphincter  
doesn’t support:

> On Jul 31, 12:20 am, Eric H. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:
> 
> > Sphincter version 1.0.0 has been released!
> > 
> > Problems:
> > 
> > - Setting match mode not supported.
> > - Setting sort mode not supported.
> > - Setting per-field weights not supported.
> > - Setting id range not supported.
> > - Setting group-by not supported.

But I bet you don’t need those anyhow, and if you did, they’ll be  
easy to add.

I started with ultrasphinx, but I couldn’t understand how to set it  
up to do what I wanted, I couldn’t read the code, and it would’ve  
taken me longer to untangle it enough to make it do what I wanted  
than to build something from scratch.

With ultrasphinx:

- You don’t have full automatic configuration. There’s some  
automatic configuration, but its in the sphinx.conf format rather  
than handy yaml, and its less automated.
- You don’t get tested code. (ultrasphinx is about 2x the LOC as  
Sphincter and has about 3x the magic.)
- You don’t get easy searches via associations like  
my\_blog.posts.search for free.
- You don’t get daemon-free testing of searching.
- You do get spelling support (but I can’t see where it is tied in)
- You do get excerpting
- You do get scary warnings from searchd about missing indexes.

–  
Poor workers blame their tools. Good workers build better tools. The  
best workers get their tools to do the work for them. – Syndicate Wars

---

<div class="post-metadata">

**Author:** ![miracleofmagick](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/71c47a/32.png) [@miracleofmagick](https://www.ruby-forum.com/u/miracleofmagick)\
**Post date:** [August 1, 2007, 7:03pm UTC](https://www.ruby-forum.com/t/ann-sphincter-1-0-0-released/110792/4 "2007-08-01T19:03:57Z")

</div>

Do you have any comparison between this and acts\_as\_solr? That’s  
pretty simple to use as well.

Thanks

---

<div class="post-metadata">

**Author:** ![miracleofmagick](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/71c47a/32.png) [@miracleofmagick](https://www.ruby-forum.com/u/miracleofmagick)\
**Post date:** [August 1, 2007, 8:33pm UTC](https://www.ruby-forum.com/t/ann-sphincter-1-0-0-released/110792/5 "2007-08-01T20:33:10Z")

</div>

On Aug 1, 2007, at 10:02, s.ross wrote:

> Do you have any comparison between this and acts\_as\_solr? That’s  
> pretty simple to use as well.

No, solr looks a lot bigger than Sphincter. It also requires the JRE  
which is a lot more files than just Sphinx.

Looking at its acts\_as\_solr method, Lucene has many more features in  
its search engine. You also get on-the-fly indexing, rather than  
having to use a cron job to update sphinx’s index.

Rumor has it that reindexing using Sphinx takes less time than with  
Lucene, but I wouldn’t know because I’ve never compared the too. It  
could be all lies.

–  
Poor workers blame their tools. Good workers build better tools. The  
best workers get their tools to do the work for them. – Syndicate Wars

---

<div class="post-metadata">

**Author:** ![miracleofmagick](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/71c47a/32.png) [@miracleofmagick](https://www.ruby-forum.com/u/miracleofmagick)\
**Post date:** [August 1, 2007, 8:51pm UTC](https://www.ruby-forum.com/t/ann-sphincter-1-0-0-released/110792/6 "2007-08-01T20:51:13Z")

</div>

On Aug 1, 2007, at 11:32 AM, Eric H. wrote:

> its search engine. You also get on-the-fly indexing, rather than  
> having to use a cron job to update sphinx’s index.
> 
> Rumor has it that reindexing using Sphinx takes less time than with  
> Lucene, but I wouldn’t know because I’ve never compared the too. It  
> could be all lies.

I’ve seen sphinx index the same dataset in under 2 minutes that it  
took solr 20 minutes to index. Solr does have more features, but boy  
sphinx is fast and easy to work with.

Cheers-  
– Ezra Z.  
– Founder & Ruby Hacker  
– removed\_email\_address@domain.invalid  
– Engine Y., Serious Rails Hosting  
– (866) 518-YARD (9273)
