I\'m using sunspot
. How can I run a LIKE
query (LIKE %q%
)? I would like to do something like this:
@search = Sunspot.
If you use the standard DisMax handler, it does not support wildcards. You have 2 options:
a. Activate EdgeNGramFilter:
<fieldType name="text" class="solr.TextField" omitNorms="false">
<analyzer type="index">
..
<filter class="solr.EdgeNGramFilterFactory" minGramSize="2" maxGramSize="15" side="front"/>
..
</analyzer>
</fieldType>
b. Use nightly build Solr with EDismax Handler.
See wiki article on sunspot docs or similar question on SO.