Skip to content

Allow a provider to declare that a document in a protected index is not a resource #6527

Description

@DarshitChanpura

ResourceIndexListener.postIndex creates a sharing record for every document written to a protected index. The only discriminator available to a provider is typeField(), which selects between registered types on a shared index (ResourcePluginInfo.java:192-207). There is no way to declare that a document is not a resource at all.

.plugins-ml-model is the concrete case: it holds one document per model chunk (MLModelManager.java:1042-1047, IMMEDIATE refresh), so protecting the type creates a parentless sharing record per chunk every time a chunked local model is registered.

A plugin can work around it by stamping a discriminator on the resource document only and declaring that as typeField() — chunks then resolve to no provider and are skipped at ResourceIndexListener.java:76-86 — but that logs a WARN per skipped write, which reads as an error and is not one.

Requests:

  1. A provider-level way to declare that a document in a protected index is not a resource.
  2. Downgrade the "type is not declared as a protected type" warning for indices that legitimately hold non-resource documents.

Note for implementers: a presence check on a numeric field cannot reuse extractFieldFromIndexOp, which reads stringValue() / binaryValue() only (ResourcePluginInfo.java:154-167). chunk_number is mapped long.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestuntriagedRequire the attention of the repository maintainers and may need to be prioritized

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions