Class NumFieldLimitingUpdateRequestProcessorFactory

  • All Implemented Interfaces:
    NamedListInitializedPlugin

    public class NumFieldLimitingUpdateRequestProcessorFactory
    extends UpdateRequestProcessorFactory
    This factory generates an UpdateRequestProcessor which fails update requests once a core has exceeded a configurable maximum number of fields. Meant as a safeguard to help users notice potentially-dangerous schema design before performance and stability problems start to occur.

    The URP uses the core's SolrIndexSearcher to judge the current number of fields. Accordingly, it undercounts the number of fields in the core - missing all fields added since the previous searcher was opened. As such, the URP's request-blocking is "best effort" - it cannot be relied on as a precise limit on the number of fields.

    Additionally, the field-counting includes all documents present in the index, including any deleted docs that haven't yet been purged via segment merging. Note that this can differ significantly from the number of fields defined in managed-schema.xml - especially when dynamic fields are enabled. The only way to reduce this field count is to delete documents and wait until the deleted documents have been removed by segment merges. Users may of course speed up this process by tweaking Solr's segment-merging, triggering an "optimize" operation, etc.

    NumFieldLimitingUpdateRequestProcessorFactory accepts two configuration parameters:

    • maxFields - (required) The maximum number of fields before update requests should be aborted. Once this limit has been exceeded, additional update requests will fail until fields have been removed or the "maxFields" is increased.
    • warnOnly - (optional) If true then the URP logs verbose warnings about the limit being exceeded but doesn't abort update requests. Defaults to false if not specified
    Since:
    9.7.0