Solr only supports mapping of values to field names, not mapping to field
types. Field names are then mapped to field types.
DynamicField only supports prefix OR suffix wildcard, not both in the same
pattern.
In the future, please take care to design your data model with the features
and limitations of Solr in mind, then you won't find yourself boxed into a
corner like this.
In short, it sounds like you need to go back to the drawing board and
redesign your data model.
Also, take a look at the schemaless and dynamic schema modes that have
recently been added to Solr - these provide the tools to dynamically add
fields to a schema.
See:
https://cwiki.apache.org/confluence/display/solr/Schemaless+Mode
Dynamic field are a very powerful feature of Solr, but please don't treat
them as a panacea for weak data modeling. Use them only in moderation.
-- Jack Krupansky
-----Original Message-----
From: John Thorhauer
Sent: Friday, April 25, 2014 7:49 AM
To: solr-user@lucene.apache.org
Subject: Re: dynamic field assignments
Jack,
Thanks for your help.
Reading your last paragraph, how is that any different than exactly what
DynamicField actually does?
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'.
You say you want to change fields at "run time" - what is "run time"? When
exactly do your field names change?
What I mean is that when the document is fed to solr. So on the
update process when the document is being indexed. The document that
is being indexed may have fields that are unknown until the time of
indexing. However, some of those fields will follow a predictable
naming patter as mentioned above.
You can always write an update request processor to do any manipulation of
field values at index time.
I see that Solr has this capability. However, I dont think I need to
manipulate field values. I need to map a field/value to a particular
fieldType for indexing.