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

fix(searchindex): search index wasn't exported #930

Merged
merged 1 commit into from
Apr 15, 2024

Conversation

noseworthy
Copy link
Contributor

The search index decorator (@searchIndex()) was added in v12.3.0 in PR #921 but I neglected to actually export the decorator so it isn't currently available for use.

Related Issues

  • N/A

The search index decorator (`@searchIndex()`) was added in `v12.3.0` in
PR typegoose#921 but I neglected to actually export the decorator so it isn't
currently available for use.
@noseworthy
Copy link
Contributor Author

Hey @hasezoey, I screwed up and forgot to actually export the @searchIndex() decorator 🤦‍♂️.
This should fix the issue. I've made the PR into master but I can change it to target v12.3.0 or beta or something depending on how you want to release this. Thanks for taking a look.

Copy link

codecov bot commented Apr 15, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.68%. Comparing base (2c538ac) to head (d79ab8d).
Report is 2 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #930   +/-   ##
=======================================
  Coverage   98.67%   98.68%           
=======================================
  Files          18       18           
  Lines         984      985    +1     
  Branches      252      264   +12     
=======================================
+ Hits          971      972    +1     
  Misses         13       13           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@hasezoey hasezoey left a comment

Choose a reason for hiding this comment

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

Thanks, didnt check that too; though it was available if directly importing (nothing was preventing it) like import * from "@typegoose/typegoose/searchIndexes.js"

@hasezoey hasezoey merged commit 9674e51 into typegoose:master Apr 15, 2024
11 checks passed
Copy link

🎉 This PR is included in version 12.3.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Copy link

🎉 This PR is included in version 12.4.0-beta.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

@jonny-dungeons
Copy link

When I apply the searchIndex decorator to a model, along with setting autoSearchIndex to true in the modelOptions, I expect to see the automatically created index when I go to my atlas cluster in the Search Indexes tab. I see Indexes but I do not see Search Indexes. What am I doing wrong?

@hasezoey
Copy link
Member

hasezoey commented May 2, 2024

@jonny-dungeons please open a new issue or discussion

i dont know how long it takes to create such indexes, so maybe try await YourModel.init().
aside from that, did you already try running await YourModel.syncIndexes()? (though i dont know if this also syncs search indexes)

if that does not fix it, maybe try debugging with mongoose.set('debug', true) (i recommend putting this before mongoose.connect call)

@noseworthy noseworthy deleted the export-search-index branch May 6, 2024 13:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants