I was wondering if there is anyway to set up a default search proximity within solr via the solrconfig.xml.
Currently, if I want to perform a proximity search I would have to do the following:
q="red cars"~10
Is there a way to set the 10 word proximity by default so that all queries are proximity searches with a 10 word proximity range?
By using eDismax, you set the proximity as default slop.
The proximity would be enabled by default as the search would look for words that are slop distance apart.
Check Query Phrase Slop and Phrase slop which will set the slop for the queries.
Query Phrase Slop is applied to Phrase Queries.
While, Phrase slop will be applied to normal queries.
<requestHandler name="standard" class="solr.SearchHandler" default="true">
<lst name="defaults">
<str name="defType">edismax</str>
<str name="echoParams">explicit</str>
<str name="qf">field</str>
<str name="qs">10</str>
<str name="pf">field</str>
<str name="ps">10</str>
<str name="q.alt">*:*</str>
</lst>
</requestHandler>