-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Text Index Support #4081
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
Text Index Support #4081
Conversation
Codecov Report
@@ Coverage Diff @@
## master #4081 +/- ##
==========================================
- Coverage 90.7% 90.68% -0.02%
==========================================
Files 116 116
Lines 7916 7926 +10
==========================================
+ Hits 7180 7188 +8
- Misses 736 738 +2
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## master #4081 +/- ##
==========================================
- Coverage 90.84% 90.82% -0.02%
==========================================
Files 116 116
Lines 7993 8003 +10
==========================================
+ Hits 7261 7269 +8
- Misses 732 734 +2
Continue to review full report at Codecov.
|
}; | ||
return this.createIndex(className, index) | ||
.catch((error) => { | ||
if (error.code === 85) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of throwing error I could delete all current text indexes, add the new one and retry.
@dplewis just wanted to check in and see where this stands. If I understand correctly all that's missing is the ability to handle compound indexes? |
@montymxb It depends on the level of support we want. One field per Two or more fields per A) Edit: we also have to keep in mind that some users may still manage their own indexes and those indexes may conflict with the indexes created by the server. Thoughts? |
@dplewis gotcha. Personally I am not entirely familiar with index management in mongodb. I will be looking into this more to bring myself up to speed so I can more effectively assist in this regard, especially if we choose to work with compound indexes in the future. In reference to what you've shown it would be ideal to have 2 or more, but I think the simplest route of 1 index will suffice for now. Given this will be a relatively new feature we can worry about enhancing it for multi-index per collection if interests perks up for that. Everyone will have been managing indexes by hand until now so we'll see how this goes. I think returning an error informing the user they should clear existing indexes would be a good start as well. We don't support managing them (yet), just creating them as needed and if able to do so. This way if we have an index conflict it shouldn't be deleting anything that may have been created by hand outside of parse. Just got back from a vacation, sorry for the delay on the follow up! |
@flovilmart Thoughts? |
I like that the index gets automatically created like the geopoints and for sure more complex indexing may be needed by the user himself. |
@flovilmart Is this good to go? Also whats happening with travis? |
@dplewis restarted the cancelled job for you, everything looks good in the test cases and code 👍. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes look good, tests look good.
Awesome! Merging! |
Attempts to add an text index if
$text
exists in query.