Hi, In general, if you use dynamic fields you will have to live with some predictable naming pattern. If you want to stick with dynamic fields, but use clean names, there are a few features worth looking at;
Field name aliases: https://cwiki.apache.org/confluence/display/solr/Common+Query+Parameters#CommonQueryParameters-FieldNameAliases This renames fields in the result set Aliases in edismax http://wiki.apache.org/solr/ExtendedDisMax#Field_aliasing_.2F_renaming Lets your users query pretty field names instead of the dynamic ones If this is not for you, please consider the new Schema API, in which you can programmatically add fields to the schema right before you need them: https://cwiki.apache.org/confluence/display/solr/Schema+API -- Jan Høydahl, search solution architect Cominvent AS - www.cominvent.com 22. okt. 2013 kl. 12:53 skrev jimi.hulleg...@svensktnaringsliv.se: > Hi, > > Is there a way to dynamically change a field name using some magic regex or > similar in the schema file? > For example, if we have a field named "subtitle_string_indexed_stored", then > we could have a dynamic field that matches "*_string_indexed_stored" and then > renames it to simply "subtitle" (ie simply removes the > "_string_indexed_stored" part). > > The reasons we want this are: > > 1. We don't want to have to update the schema every time we need to > index/store a new field. > > 2. We want to be able to specify how each field should be indexed/stored. > > 3. We want to be able to use simple and clean field names when searching and > fetching stored fields. Like "subtitle". > > > Number one above means that we must use dynamic fields of some type (right?). > And number two means that we must have a separate dynamic field for each > configuration combination, and the only way to controll that is by some > naming standard in the field names. > > So these two combined means that we will end up with fields with ugly > prefixes that controlls the internal behaivor of solr. Ie it doesn't go well > combined with the third number in the list above. > > Is there a way to solve this? > > > Regards > /Jimi