Class NumFieldLimitingUpdateRequestProcessorFactory
- java.lang.Object
-
- org.apache.solr.update.processor.UpdateRequestProcessorFactory
-
- org.apache.solr.update.processor.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) Iftrue
then the URP logs verbose warnings about the limit being exceeded but doesn't abort update requests. Defaults tofalse
if not specified
- Since:
- 9.7.0
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.solr.update.processor.UpdateRequestProcessorFactory
UpdateRequestProcessorFactory.RunAlways
-
-
Constructor Summary
Constructors Constructor Description NumFieldLimitingUpdateRequestProcessorFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description UpdateRequestProcessor
getInstance(SolrQueryRequest req, SolrQueryResponse rsp, UpdateRequestProcessor next)
void
init(org.apache.solr.common.util.NamedList<?> args)
init
will be called just once, immediately after creation.
-
-
-
Method Detail
-
init
public void init(org.apache.solr.common.util.NamedList<?> args)
Description copied from interface:NamedListInitializedPlugin
init
will be called just once, immediately after creation.Source of the initialization arguments will typically be solrconfig.xml, but will ultimately depends on the plugin itself
- Parameters:
args
- non-null list of initialization parameters (may be empty)
-
getInstance
public UpdateRequestProcessor getInstance(SolrQueryRequest req, SolrQueryResponse rsp, UpdateRequestProcessor next)
- Specified by:
getInstance
in classUpdateRequestProcessorFactory
-
-