Thank you Jack, I've totally missed this type of plug-in.

Artem.

25.07.2013 23:38, Jack Krupansky пишет:
Yeah, those are the rules. They are more of a heuristic that manages to work
most of the time reasonably well, but like most heuristics, it is not
perfect.

In this particular case, your best bet would be to use an update processor
to discard the "ignored" field values before Solr actually sees them at the
dynamic field pattern match level.

See:
http://lucene.apache.org/solr/4_4_0/solr-core/org/apache/solr/update/processor/IgnoreFieldUpdateProcessorFactory.html

<processor class="solr.IgnoreFieldUpdateProcessorFactory">
    <str name="fieldRegex">solr_.*</str>
</processor>

You can use full regex patterns or lists of field names. (I have more
examples in my book.)

-- Jack Krupansky

-----Original Message-----
From: Artem Karpenko
Sent: Thursday, July 25, 2013 11:05 AM
To: solr-user@lucene.apache.org
Subject: Wildcard matching of dynamic fields

Hi,

given a dynamic field

<dynamicField name="*_boolean" type="boolean" indexed="true"
stored="true" />

There are some other suffix-based fields as well. And some of the fields
in document should be ignored, they have "nosolr_" prefix. But defining

<dynamicField name="nosolr_*" type="ignored" indexed="false"
stored="false" />

even at the start of schema does not work, field
"nosolr_inv_dunning_boolean" is recognized as boolean anyway and shown
in search results. Documentation says that "longer patterns will be
matched first, if equal size patterns both match, the first appearing in
the schema will be used".

What can be done here (except from changing input document)? And,
generally,: why would such "longer wins" strategy be used here? What use
case does it have?

Best,
Artem.


Reply via email to