Mixed legacy $search + extension $vectorSearch in hybrid search on a view drops the index

XMLWordPrintableJSON

    • Query Integration
    • Fully Compatible
    • ALL
    • v9.0
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Summary

      Hybrid search ($scoreFusion / $rankFusion) on a view whose input pipelines mix a legacy $search with an extension $vectorSearch fails with Location65160 -- the extension $vectorSearch's index is not forwarded to mongot.

      Description

      In the with_mongot_extension_* suites, $vectorSearch runs through the extension (featureFlagVectorSearchExtension: true) while $search remains legacy (featureFlagSearchExtension: false). When both appear as input pipelines of a single $scoreFusion/$rankFusion executed against a view, the query fails:

      Executor error during aggregate command on namespace: test.score\_fusion\_on\_view\_multi\_search\_view
      :: caused by :: remote error from mongot: "index" is required
      code: 65160, codeName: "Location65160"
      

      Example failing pipeline (the multi_search case):

      db..aggregate\(\[{
        $scoreFusion: {
          input: {
            pipelines: {
              a: \[{$search: {index: "searchIndex2", text: {query: "bar", path: "m"}}}\],
              b: \[{$vectorSearch: {queryVector: \[...\], path: "v", numCandidates: 60, index: "vectorSearchIndex1", limit: 60}}\]
            },
            normalization: "sigmoid"
          },
          combination: {method: "avg"}
        }
      }\]\)
      

      Pure-$search and pure-$vectorSearch hybrid queries on the same view pass; only the mixed (one legacy + one extension mongot stage) case fails, which points at the extension $vectorSearch losing its index during view resolution / request assembly when combined with a legacy mongot stage.

      Environment

      * Suites: with_mongot_extension_single_node (fails); not observed on sharded topologies in the same run (those aborted earlier on other failures -- confirm whether it also reproduces there).
      * Flag: featureFlagExtensionsInsideHybridSearch: true (latent with it off, since the IFR kickback falls back to legacy $vectorSearch).

      Failing tests (currently excluded)

      * jstests/with_mongot/e2e/hybridSearch/score_fusion_on_view.js
      * jstests/with_mongot/e2e/hybridSearch/ranked_fusion_on_view.js

      Acceptance criteria

      Remove the exclusion for these two tests from buildscripts/resmokeconfig/matrix_suites/overrides/with_mongot_extension.yml (regenerate matrix suites) and they pass in the with_mongot_extension_* suites with the flag on.

            Assignee:
            Mariano Shaar
            Reporter:
            Will Buerger
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: