In order to accomplish the behavior that you are desiring, you will need to change the fieldType for the dynamic field in your schema.xml. Currently, your pa_mydyanmicfieldname
is probably defined as a type="text_general"
and with multivalued="true"
. So your field value is being split into tokens and these tokens are then being stored as multiple values. This is producing the behavior you show with multiple words/tokens being returned as facet values.
Since you want to store the original value as you submit it, please change your fieldType to just a plain old string and not multivalued:
<dynamicField name="*_mydynamicfeldname" type="string"
indexed="true" stored="true"/>
Or you can alternately take advantage of the predefined string based dynamic field defined in the example schema.xml:
<dynamicField name="*_s" type="string" indexed="true" stored="true" />
You will need to reindex your data after making this change to your schema.xml for new field types to be stored properly and reflected in the search results.