Skip to content

Conversation

@andreaangiolillo
Copy link
Collaborator

@andreaangiolillo andreaangiolillo commented May 21, 2025

Proposed changes

Jira ticket: CLOUDP-316626

Bug:

The CLI is marshing directly the SDK struct into Bson for the createSearchIndex this cause fields in the structs such as charFilters to be transformed in their lowercase version charfilters.

atlas deployments search indexes create --deploymentName local9975 --type LOCAL -f search-index.json --watch
Error: (UnknownError) "userCommand.indexes[0].analyzers[0]" unrecognized fields ["charfilters", "tokenfilters"]

Fix:

As we are doing with other index such as ClusterSearchIndex, we first marsh the struct into json and then marsh into Bson to keep the same field names of the original SDK struct.

./bin/atlas deployments search indexes create --deploymentName local9975 --type LOCAL -f search-index.json --watch
Search index created with ID: 682dce72481bfa62cd0cb969

atlas deployments search indexes ls                                            
? Database sample_mflix
? Collection movies
ID                         NAME                 DATABASE       COLLECTION   STATUS   TYPE
682dce72481bfa62cd0cb969   custom_movie_index   sample_mflix   movies       READY    search

@andreaangiolillo andreaangiolillo marked this pull request as ready for review May 21, 2025 13:22
@andreaangiolillo andreaangiolillo requested a review from a team as a code owner May 21, 2025 13:22
@andreaangiolillo andreaangiolillo requested a review from fmenezes May 21, 2025 13:24
@github-actions
Copy link
Contributor

Coverage Report 📈

Branch Commit Coverage
master ced6b1f 25.1%
CLOUDP-316626 2f3fac9 25.1%
Difference 0%

@andreaangiolillo andreaangiolillo merged commit 414804a into master May 21, 2025
23 of 24 checks passed
@andreaangiolillo andreaangiolillo deleted the CLOUDP-316626 branch May 21, 2025 13:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants