Nevermind this one... With a bit more research I discovered I can use
spellcheck.q to provide the correct suggestion.

On 14 September 2010 16:02, Glen Stampoultzis <gst...@gmail.com> wrote:
> Hi,
>
> I'm trying to spell check a whole field using a lowercasing keyword
> tokenizer [1].
>
> for example if I query for "furntree gully" I'm hoping to get back
> "ferntree gully" as a suggestion.  Unfortunately the spell checker
> seems to be recognizing this as two tokens and returning suggestions
> for both.  Query [2] and result [3] below.  In this case ferntree
> actually does end up with ferntree gully as a suggestion however it
> also gives bulla as a suggestion for gully (go figure :-) ).
>
> Any suggestions?
>
> Regards,
>
> Glen
>
>
> [1] ---------------------------------------------
>
>        <fieldType name="lowercase" class="solr.TextField"
> positionIncrementGap="100">
>            <analyzer>
>                <tokenizer class="solr.KeywordTokenizerFactory"/>
>                <filter class="solr.LowerCaseFilterFactory" />
>            </analyzer>
>        </fieldType>
>
> [2] ---------------------------------------------
>
> Query
>
> q=locality_lc%3A%22furntree+gully%22&spellcheck=true&spellcheck.build=true&spellcheck.reload=true&spellcheck.accuracy=0.5&spellcheck.dictionary=locality_spellchecker&spellcheck.collate=true&fl=street_name%2Clocality%2Cstate
>
> [3] ---------------------------------------------
>
> <response>
>  <lst name="responseHeader">
>    <int name="status">
>      0
>    </int>
>    <int name="QTime">
>      379
>    </int>
>    <lst name="params">
>      <str name="spellcheck">
>        true
>      </str>
>      <str name="fl">
>        street_name,locality,state
>      </str>
>      <str name="spellcheck.accuracy">
>        0.5
>      </str>
>      <str name="q">
>        locality_lc:&quot;furntree gully&quot;
>      </str>
>      <str name="spellcheck.dictionary">
>        locality_spellchecker
>      </str>
>      <str name="spellcheck.collate">
>        true
>      </str>
>      <str name="spellcheck.reload">
>        true
>      </str>
>      <str name="spellcheck.build">
>        true
>      </str>
>    </lst>
>  </lst>
>  <str name="command">
>    build
>  </str>
>  <result name="response" numFound="0" start="0"/>
>  <lst name="spellcheck">
>    <lst name="suggestions">
>      <lst name="furntree">
>        <int name="numFound">
>          1
>        </int>
>        <int name="startOffset">
>          13
>        </int>
>        <int name="endOffset">
>          21
>        </int>
>        <arr name="suggestion">
>          <str>
>            ferntree gully
>          </str>
>        </arr>
>      </lst>
>      <lst name="gully">
>        <int name="numFound">
>          1
>        </int>
>        <int name="startOffset">
>          22
>        </int>
>        <int name="endOffset">
>          27
>        </int>
>        <arr name="suggestion">
>          <str>
>            bulla
>          </str>
>        </arr>
>      </lst>
>      <str name="collation">
>        locality_lc:&quot;ferntree gully bulla&quot;
>      </str>
>    </lst>
>  </lst>
> </response>
>

Reply via email to