Skip to content

feat: listSearchIndexes now lists index status info #258

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

manoj-pillay-10gen
Copy link
Collaborator

@manoj-pillay-10gen manoj-pillay-10gen commented May 16, 2025

Description

Before

List search indexes provided name and index definition

After

List search indexes returns a lot more information including status and queryability etc.
Sample output from inspector included below:

Name: "mihir-fullplot-auto-embedding"
Definition: {
  "fields": [
    {
      "path": "fullplot",
      "model": "voyage-3",
      "type": "text"
    }
  ]
}
Queryable: true
Status: "READY"
Status Detail: [
  {
    "hostname": "defaultmcpserver-shard-00-search-bneowl",
    "status": "READY",
    "queryable": true,
    "mainIndex": {
      "status": "READY",
      "queryable": true,
      "definitionVersion": {
        "version": 0,
        "createdAt": "2025-05-15T17:16:01.000Z"
      },
      "definition": {
        "fields": [
          {
            "type": "text",
            "path": "fullplot",
            "model": "voyage-3"
          }
        ]
      }
    }
  },
  {
    "hostname": "defaultmcpserver-shard-00-search-hd3i7c",
    "status": "READY",
    "queryable": true,
    "mainIndex": {
      "status": "READY",
      "queryable": true,
      "definitionVersion": {
        "version": 0,
        "createdAt": "2025-05-15T17:16:01.000Z"
      },
      "definition": {
        "fields": [
          {
            "type": "text",
            "path": "fullplot",
            "model": "voyage-3"
          }
        ]
      }
    }
  },
  {
    "hostname": "defaultmcpserver-shard-00-search-pzf4ol",
    "status": "READY",
    "queryable": true,
    "mainIndex": {
      "status": "READY",
      "queryable": true,
      "definitionVersion": {
        "version": 0,
        "createdAt": "2025-05-15T17:16:01.000Z"
      },
      "definition": {
        "fields": [
          {
            "type": "text",
            "path": "fullplot",
            "model": "voyage-3"
          }
        ]
      }
    }
  }
]
Definition Version: {
  "version": 0,
  "createdAt": "2025-05-15T17:16:01.443Z"
}
Synonym Mapping Status: undefined
Synonym Mapping Status Detail: undefined
ID: 6826215184858a6fabcd7c3d

@manoj-pillay-10gen manoj-pillay-10gen requested a review from a team as a code owner May 16, 2025 07:51
@manoj-pillay-10gen manoj-pillay-10gen requested review from Copilot and removed request for a team May 16, 2025 07:57
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Adds richer status information to the search index listing operation, exposing queryability, status details, and synonym mapping info.

  • Replaces the simple SearchIndex interface with ListSearchIndexOutput to capture full index metadata.
  • Maps and formats additional fields (status, queryable, statusDetail, definitionVersion, synonymMappingStatus, id) into the tool’s output.
  • Updates the README to include the new collection-search-indexes command (and several other search/vector index commands).

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
src/tools/mongodb/read/collectionSearchIndexes.ts Swapped in ListSearchIndexOutput, mapped new properties, and formatted output text.
src/common/search/listSearchIndexesOutput.ts Introduced interfaces for the full search index output schema.
README.md Documented the collection-search-indexes tool and related search/vector index commands.
Comments suppressed due to low confidence (2)

src/common/search/listSearchIndexesOutput.ts:10

  • [nitpick] The interface name SynonymMappingStatusDetails (plural) is very similar to SynonymMappingStatusDetail defined later, which may lead to confusion. Consider renaming one of them to clarify their distinct purposes.
export interface SynonymMappingStatusDetails {

README.md:145

  • [nitpick] This PR primarily enhances the search-index listing tool but also adds several unrelated command entries (e.g., create-search-index, update-vector-index, run-pipeline). It would improve clarity to limit this PR’s README changes to the collection-search-indexes entry or split other command docs into a separate PR.
- `create-search-index` - Create a search index for a MongoDB collection

@manoj-pillay-10gen manoj-pillay-10gen merged commit b8a85a3 into search-skunkworks-2025 May 16, 2025
9 checks passed
@manoj-pillay-10gen manoj-pillay-10gen deleted the search-skunkworks-2025-search-index-status branch May 16, 2025 14:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants