Skip to content
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

DRIVERS-2768: Restore missing "type" option docs for search indexes #1650

Merged
merged 1 commit into from
Sep 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 31 additions & 7 deletions source/index-management/index-management.md
Original file line number Diff line number Diff line change
Expand Up @@ -902,19 +902,39 @@ await collection.dropSearchIndex('my-test-index');

```typescript
interface SearchIndexModel {
// The definition for this index.
/**
* Document describing the index to create.
*
* The definition syntax depends on whether you create a standard search index
* or a vector search index.
*
* @see https://www.mongodb.com/docs/manual/reference/command/createSearchIndexes/
*/
definition: Document;

// The name for this index, if present.
name: Optional<string>;

// The type for this index, if present. Can be either "search" or "vectorSearch".
type: Optional<string>;
/**
* Contains the options for the index.
*/
options: SearchIndexOptions;
}

interface SearchIndexOptions {
// The name for this index, if present.
/**
* Name of the search index to create.
*
* The server will use "default" if this option is not specified.
*/
name: Optional<string>;

/**
* Type of search index to create. Defaults to "search" if not provided.
*
* Specify "search" for a standard search index or "vectorSearch" for a vector
* search index.
*
* The server will use "search" if this option is not specified.
*/
type: Optional<string>;
}

/**
Expand Down Expand Up @@ -1125,6 +1145,10 @@ from mistakenly specifying this option, drivers manually verify it is only sent

#### Changelog

- 2024-09-05: Moved options in SearchIndexModel to SearchIndexOptions for consistency with IndexModel and IndexOptions.

- 2024-03-06: Added `type` option to SearchIndexOptions.

- 2024-03-05: Migrated from reStructuredText to Markdown.

- 2023-11-08: Clarify that `readConcern` and `writeConcern` must not be applied to search index management commands.
Expand Down
Loading