I just added some wildcard dynamic fields to my solr schema:
<dynamicField name="*_s" type="string" indexed="true" stored="true"/>
Then I add a document with field name like asdfasdf_s
If I do a query that brings up this document, I see that asdfasdf_s is stored in the results with the value I set.
However, if I search by the value in that dynamic field, I get no results. I am using the dismax query parser.
This is most likely because you have type field type of your dynamic fields set to
string
. By default the string field type, as shown below is not overly search friendly, as it does not have any index or query time analyzers associated with it.I would suggest that you change to something like the
text_general
field type as shown below.As the text_general is better suited to querying the field as it tokenizes, lowercases and provides synonyms for values added to it. One quick way to gain the same benefits without changing your field type for the dynamics would be to use copyField to copy your dynamic values to a
text_general
field type or some other field type that would be better to querying against.