Reading your last paragraph, how is that any different than exactly what DynamicField actually does?

You say you want to change fields at "run time" - what is "run time"? When exactly do your field names change? To be clear, field names do not change in Solr once the data is written to the index.

You can always write an update request processor to do any manipulation of field values at index time.

Have you had your data model reviewed by a professional Solr consultant to verify that it is indeed a reasonable approach? We can answer direct questions on this list, but it is not a substitute for professional review.

-- Jack Krupansky

-----Original Message----- From: John Thorhauer
Sent: Friday, April 25, 2014 7:10 AM
To: solr-user@lucene.apache.org
Subject: dynamic field assignments

I have a scenario where I would like dynamically assign incoming
document fields to two different solr schema fieldTypes.  One
fieldType will be an exact match fieldType while the other will be a
full text fieldType.  I know that I can use the dynamicField to assign
fields using the asterisk in a naming pattern.  However, I have a set
of incoming data in which the field names can change at run time.  The
fields will follow a predictable pattern but the pattern can not be
recognized using the dynamicField type.

So here is an example of the new types of field names that I need to
be able to process:

FOO_BAR_TEXT_1
FOO_BAR_TEXT_2
FOO_BAR_TEXT_3
FOO_BAR_TEXT_4

FOO_BAR_SELECT_1
FOO_BAR_SELECT_2
FOO_BAR_SELECT_3

So the above fields will not be defined in advance.  I need to map all
fields with the name FOO_BAR_SELECT_* to a fieldType of 'exactMatch'
and I need to map all of the fields with name FOO_BAR_TEXT_* to a
fieldType of full'text'.  I was hoping there might be a way of doing
this dynamically.  Does anyone have any ideas how to approach this?

Thanks,
John Thorhauer

Reply via email to