On 5/29/2014 12:50 AM, Elran Dvir wrote:
> In my index, I have an EnumField called severity. This is its configuration 
> in enumsConfig.xml:
> 
> <enum name="severity"> 
>       <value>Not Available</value> 
>       <value>Low</value>
>        <value>Medium</value>
>        <value>High</value>
>        <value>Critical</value>
>  </enum>
> 
> My index contains documents with these values.
> When I search for severity:High, I get results. But when I search for 
> severity:H* , I get no results.
> What do  I need to change in Solr code to enable wildcard matches in 
> EnumField  (or any other field)?

I would suspect that enum fields are not actually stored as text.  They
are likely stored in the index as an integer, with the Solr schema being
the piece that knows what the strings are for each of the numbers.  I
don't think a wildcard match is possible.

Looking at the code for the EnumFieldValue class (added by SOLR-5084), I
do not see any way to match the string value based on a wildcard or
substring.

If you want to use wildcard matches, you'll need to switch the field to
StrField or TextField, and make sure that all of your code is strict
about the values that can end up in the field.

Thanks,
Shawn

Reply via email to