# Apostrophe handling how to

**URL:** <https://www.ruby-forum.com/t/apostrophe-handling-how-to/120170>\
**Category:** Ferret\
**Created:** [November 14, 2007, 1:33pm UTC](https://www.ruby-forum.com/t/apostrophe-handling-how-to/120170 "2007-11-14T13:33:10Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jags](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/dc4da7/32.png) [@jags](https://www.ruby-forum.com/u/jags)\
**Post date:** [November 14, 2007, 1:33pm UTC](https://www.ruby-forum.com/t/apostrophe-handling-how-to/120170/1 "2007-11-14T13:33:10Z")

</div>

hi all,

i am using acts\_as\_ferret plugin(0.4.1 Latest) with ferret gem(0.11.4  
Latest)  
on rails 1.2.5 and ruby 1.8.6(UBUNTU Gutsy)  
i have this  
:Product Model  
acts\_as\_ferret :fields =\> {:name =\> { :boost =\> 2 ,:store =\> :yes},  
:short\_desc =\> { :boost =\> 1.5,:store =\>  
:yes },  
:tag\_list =\> {:boost =\> 1 },  
:name\_for\_sort =\> {:index =\> :untokenized}  
}

and i search using this code in my products controller

@products = Product.find\_by\_contents ‘_’+params[:q]+’_’

i have a product with short name as “hank’s outlet”

when i search for hank i get the resultant product as expected.  
but when i search with param as hank’s" or “hanks” —i dont get any  
results.

how can i get this done. pls help  
i have been trying to understand to use the analysers and tokenisers  
but couldn’t get through

thanks  
jags

---

<div class="post-metadata">

**Author:** ![jags](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/dc4da7/32.png) [@jags](https://www.ruby-forum.com/u/jags)\
**Post date:** [November 15, 2007, 11:00am UTC](https://www.ruby-forum.com/t/apostrophe-handling-how-to/120170/2 "2007-11-15T11:00:45Z")

</div>

hi all

i figured out that removing the wildcards around the param[:q]  
i get

when searched for hank i get the results  
hank and hank’s

when searched for hank’s i get the results  
hank and hank’s ------here it is this was not working earlier(the  
plurals search)

but now how do i get the results for searches with  
han  
ha

i get no results.i want all the results starting with ‘han’ or ‘ha’ here

pls help
