[M1 - Search Extension] Update $$SEARCH_META validation helpers to recognize $_documentResultsAndMetadata

XMLWordPrintableJSON

    • Query Integration
    • Fully Compatible
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Overview

      Update two $$SEARCH_META validation functions in search_helper.cpp to recognize $_documentResultsAndMetadata as a stage that sets $$SEARCH_META.

      Background

      Two functions gate $$SEARCH_META access but are unaware of the new container stage, causing false errors for extension-backed $search pipelines:

      • assertSearchMetaAccessValidHelper throws error 6347902 ("can't access $$SEARCH_META without a $search stage") if no recognized setter appears earlier in the pipeline. It currently recognizes $_internalSearchMongotRemote, $search, $setVariableFromSubPipeline, and $_extensionSearch, but not $_documentResultsAndMetadata.
        • Side-question: Should $_extensionSearch be included here, or is $_documentResultsAndMetadata sufficient?
      • shouldPreValidateMetaDependencies gates a pre-validation path. By the time it runs, buildFinalPipeline has reparsed the desugared LPP, meaning the original $_extensionStage is gone. It must recognize $_documentResultsAndMetadata directly.

      Scope of Work

      • Add $_documentResultsAndMetadata (conditioned on _metadata being present) to the recognized-setter list in assertSearchMetaAccessValidHelper
      • Add $_documentResultsAndMetadata to the recognized-setter check in shouldPreValidateMetaDependencies

      Acceptance Criteria

      • Pipeline with $_documentResultsAndMetadata followed by $$SEARCH_META reference does not trigger error 6347902
      • shouldPreValidateMetaDependencies correctly identifies extension-backed search pipelines
      • Existing scoping error tests (6347901, 6347902) still pass

            Assignee:
            Daniel Segel
            Reporter:
            Daniel Segel
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: