Reputation: 10208
I am using WebSolr Cobalt on Heroku. The search is working if I search whether for the first letter or the full word, but no partial parts of the word.
Any help?
Upvotes: 1
Views: 730
Reputation: 1880
To enable partial word searching
you must edit your local schema.xml file, usually under solr/config, to add either:
Here's what mine looks like - sample schema.xml
EdgeNGram
I went with the EdgeN option. It doesn't allow for searching in the middle of words, but it does allow partial word search starting from the beginning of the word. This cuts way down on false positives / matches you don't want, performs better, and is usually not missed by the users. Also, I like the minGramSize=2 so you must enter a minimum of 2 characters. Some folks set this to 3.
Once your local is setup and working, you must edit the schema.xml used by websolr, otherwise you will get the default behavior which requires the full-word to be entered even if you have full text searching configured for your models.
To edit the websolr schema.xml
heroku run rake sunspot:reindex[5000]
Take it to the next level
Upvotes: 2