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

Atlas Search index creation #14232

Closed
2 tasks done
alexbevi opened this issue Jan 4, 2024 · 0 comments
Closed
2 tasks done

Atlas Search index creation #14232

alexbevi opened this issue Jan 4, 2024 · 0 comments
Labels
enhancement This issue is a user-facing general improvement that doesn't fix a bug or add a new feature new feature This change adds new functionality, like a new method or class
Milestone

Comments

@alexbevi
Copy link
Contributor

alexbevi commented Jan 4, 2024

Prerequisites

  • I have written a descriptive issue title
  • I have searched existing issues to ensure the feature has not already been requested

🚀 Feature Proposal

With NODE-5194 being available starting with v5.7.0 of the Node driver, Search index management helpers can be exposed via Mongoose as well.

Motivation

This would allow Search Indexes to be handled the same as other indexes (Schema level only though)

Example

const animalSchema = new Schema({
  name: String,
  type: String,
});

// schema level search index
animalSchema.searchIndex("searchIndex01", { mappings: { dynamic: true } }); 
// schema level search index with language analyzer
animalSchema.searchIndex("frenchSearchIndex01", 
   {
      mappings: {
         fields: {
            subject: {
               fields: {
                  name: {
                     analyzer: "lucene.french",
                     type: "string"
                  }
               },
               type: "document"
            }
         }
      }
   }
);
@alexbevi alexbevi added enhancement This issue is a user-facing general improvement that doesn't fix a bug or add a new feature new feature This change adds new functionality, like a new method or class labels Jan 4, 2024
@vkarpov15 vkarpov15 added this to the 8.1 milestone Jan 4, 2024
vkarpov15 added a commit that referenced this issue Jan 15, 2024
Add Atlas search index helpers to Models and Schemas
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement This issue is a user-facing general improvement that doesn't fix a bug or add a new feature new feature This change adds new functionality, like a new method or class
Projects
None yet
Development

No branches or pull requests

2 participants