lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Hostetter <>
Subject Re: dynamic field assignments
Date Tue, 06 May 2014 01:50:51 GMT

: My understanding is that DynamicField can do something like
: FOO_BAR_TEXT_* but what I really need is *_TEXT_* as I might have
: FOO_BAR_TEXT_1 but I also might have WIDGET_BAR_TEXT_2.  Both of those
: field names need to map to a field type of 'fullText'.

I'm pretty sure you can get what you are after with the new Manged Schema 

Assuming you have managed schema enabled in solrconfig.xml, and you define 
both of your fieldTypes using names like "text" and "select" then 
something like this should work in your processor chain... 

 <processor class="solr.AddSchemaFieldsUpdateProcessorFactory">
   <str name="fieldRegex">.*_TEXT_.*</str>
   <str name="defaultFieldType">text</str>
 <processor class="solr.AddSchemaFieldsUpdateProcessorFactory">
   <str name="fieldRegex">.*_SELECT_.*</str>
   <str name="defaultFieldType">select</str>

(Normally that processor is used once with multiple value->type mappings 
-- but in your case you don't care about the run-time value, just the run 
time field name regex (which should also be configurable according 
to the various FieldNameSelector rules...


View raw message