Full text search for irregular rapper names with Solr

Posted by Horace Loeb on Stack Overflow See other posts from Stack Overflow or by Horace Loeb
Published on 2010-05-24T05:00:03Z Indexed on 2010/05/24 5:11 UTC
Read the original article Hit count: 290

Filed under:
|
|
|

I'm implementing full text search functionality on my rap website, and I'm running into some issues with rapper and song names.

For example, someone might want to search for the rapper "Cam'ron" using the query "camron" (leaving out the mid-word apostrophe). Likewise, someone might search for the song "3 Peat" using the query "3peat".

"The Notorious B.I.G." is a bit of a weird case: both "The Notorious BIG" and "The Notorious B.I.G." both work (I guess because the solr.StandardFilterFactory removes dots from acronyms?), but "The Notorious B.I.G" (i.e., minus the trailing dot) doesn't.

Ideally all reasonable variations of these names should work. I'm guessing the answer has something to do with the solr.WordDelimiterFilterFactory, but I'm not sure.

Also, I'm using Sunspot with Rails if that's relevant.

© Stack Overflow or respective owner

Related posts about ruby-on-rails

Related posts about ruby