solr5

Using df in Solr query with array of strings


I have field in my indexed data set called "sighting_en". It contains an array of strings.

When I perform a query using &df=sighting_en I get back zero results.

When I perform a query using another field that is just defined as a plain string, it works fine.

Is there something in my syntax that I need to change or is there something in a config file that needs to be modified to allow this field to be used with 'df'?


Solution

  • For an array of string, use multiValued="true" in schema.

    Eg. field name="sighting_en" type="string" indexed="true" stored="true" multiValued="true"

    After indexing, say the array values are {"aaa","bbb"},searching "&df=sighting_en:aaa" will give results as requested.