To configure solr / local solr for th...

To configure solr / local solr for the ChefMoz example you must change a few configurations
in the local solr example.

Begin with downloading the local solr example
wget http://www.nsshutdown.com/solr-example.tgz
tar -xvzf solr-example.tgz

cd solr-example/apache-solr-1.3-dev/example/solr
#remove the demo data directory
rm -rf data

Download and expand the chefmoz-example files.

Replace the fields in schema.xml file with the ChefMoz version (full version available in the chefmoz-example)

<fields>
<field name="id" type="string" indexed="true" stored="true"/>
<field name="location" type="text" indexed="true" stored="true"/>
<field name="title" type="text" indexed="true" stored="true" omitNorms="true"/>
<field name="address" type="text" indexed="true" stored="true" multiValued="true" omitNorms="true"/>
<field name="city" type="string" indexed="true" stored="true"/>
<field name="state" type="string" indexed="true" stored="true"/>
<field name="country" type="text" indexed="true" stored="true"/>
<field name="phone" type="string" indexed="true" stored="true"/>
<field name="description" type="text" indexed="true" stored="true"/>
<field name="recommendations" type="text" indexed="true" stored="true"/>
<field name="overallrating" type="sdouble" indexed="true" stored="true"/>
<!-- local lucene field types -->
<field name="lat" type="sdouble" indexed="true" stored="true"/>
<field name="long" type="sdouble" indexed="true" stored="true"/>
<field name="geo_distance" type="sdouble" indexed="true"/>
<dynamicField name="_local*" type="sdouble" indexed="true" stored="true"/>
</fields>

<!-- field to use to determine and enforce document uniqueness. -->
<uniqueKey>id</uniqueKey>

<!-- field for the QueryParser to use when an explicit fieldname is absent -->
<defaultSearchField>title</defaultSearchField>


Change the solrconfig.xml, again full version is available in the chefmoz-example


<updateRequestProcessor>
<factory name="standard" class="solr.ChainedUpdateProcessorFactory" default="true">
<chain class="com.pjaol.search.solr.update.LocalUpdateProcessorFactory">
<str name="latField">lat</str>
<str name="lngField">long</str>
<int name="startTier">9</int>
<int name="endTier">17</int>
</chain>
<chain class="solr.LogUpdateProcessorFactory" >
</chain>
<chain class="solr.RunUpdateProcessorFactory" />
</factory>
</updateRequestProcessor>


And

<!-- local lucene request handler -->
<requestHandler name="geo" class="com.pjaol.search.solr.LocalSolrRequestHandler">
<!-- default values for query parameters -->
<str name="latField">lat</str>
<str name="lngField">long</str>
<lst name="defaults">
<str name="echoParams">explicit</str>
</lst>
</requestHandler>`