On 8/23/2014 9:01 AM, Jack Krupansky wrote:
> It sounds as if you are trying to treat hyphen as a digit so that
> negative numbers are discrete terms. But... that conflicts with the use
> of hyphen as a word separator. Sorry, but WDF does not support both.
> Pick one or the other, you can't have both.
> 
> But first, please explain your intended use case clearly - there may be
> some better way to try to achieve it.
> 
> Use the analysis page of the Solr Admin UI to see the detailed query and
> index analysis of your terms. You'll be surprised.

You can force WDF to treat hyphen as a digit if you want to, but you are
right that you cannot have both.  To change WDF, create a text file, put
the following in it, and reference it with the types parameter on
WordDelimiterFilterFactory:

- => DIGIT

I use this functionality to build a special analysis chain for
mimetypes.  FOR that fieldType, I treat hyphen and underscore as ALPHANUM.

Search for "wdfftypes" on this page for more info:

https://wiki.apache.org/solr/AnalyzersTokenizersTokenFilters

Naturally you have to reindex after making this change.  For anyone who
doesn't know what that entails:

http://wiki.apache.org/solr/HowToReindex

Thanks,
Shawn

Reply via email to