-
-
Notifications
You must be signed in to change notification settings - Fork 509
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
Can't add a filter on a text search #2733
Comments
It seems that we need to apply the same kind of logic that we already have with mongodb-odm/lib/Doctrine/ODM/MongoDB/Aggregation/Builder.php Lines 267 to 270 in 402efbd
|
Something like this would work, don't know if it's optimal (I'm pretty new to mongodb):
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Bug Report
Summary
When adding a filter, it goes always in first stage. If the query already have a match two stages will be created, making mongodb throw an exception.
Documentation states that $match stage that includes a $text must be the first stage in the pipeline.
Current behavior
The stage that comes from filters will always be the first in pipeline.
How to reproduce
Expected behavior
In my opinion, the CriteriaMerger should be used when merging the attributes, or there should be a "reorder" before submitting the query, so the text stage should go first
The text was updated successfully, but these errors were encountered: