Dear Solrians,

I've been looking through the IndexSchema and DocumentBuilder code, hoping
to find something that is essentially a combination of what dynamicField and
copyField do.  Specifically, I'd like to say that any field that matches a
given pattern should be copied to a specific multivalued destination field.
For example, my config might contain something like:

    <!-- All text fields get thrown in here for default indexing. -->
    <field name="text" type="text" indexed="true" stored="false"
multiValued="true"/>

    <!-- Search text by default so we get all text fields. -->
    <defaultSearchField>text</defaultSearchField>

    <!-- 
        Any field ending in _t is assumed to be a text field and is thrown
into text,
        despite the fact that we may not have known of its specific
existence when
        we created the config file.
    -->
    <dynamicCopyField source="*_t" dest="text" />

The advantage of this approach over pure copyField is that we don't have to
know the full set of text fields up front when we are writing the config
file.  If a field name matches both a dynamicField and a dynamicCopyField,
then both behaviors should probably occur, although config files will not
typically be written this way.

Has anything like this been discussed or implemented before?

Looking forward to your feedback.

Thanks,

-D


Reply via email to