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

Add $search the official aggregation stage for running search queries #2460

Open
Alaarafeh opened this issue Sep 8, 2022 · 6 comments
Open
Labels
Feature Hacktoberfest Good issue for participating in Hacktoberfest

Comments

@Alaarafeh
Copy link

Doctrine\ODM\MongoDB\Aggregation\Stage we have all possible aggregation stages excapt two Stages:

  1. $search
  2. $searchMeta

Useful links:
https://www.mongodb.com/docs/atlas/atlas-search/query-syntax/

@malarzm
Copy link
Member

malarzm commented Sep 17, 2022

@Alaarafeh would you be interested in submitting a PR adding missing stages and tests for them?

@Alaarafeh
Copy link
Author

@malarzm i could give try i have already patch in my project and works for me , i will try to create PR but i don't know what version policy you have as PR (should i create new branch from current version as bug/feature) ? and which kind of tests you used (unit, integration or functional)?

@malarzm
Copy link
Member

malarzm commented Sep 20, 2022

should i create new branch from current version as bug/feature

Your contribution will be a feature in 2.5. Please target 2.4.x branch for now however, I'll take care of branching 2.5.x off once I'm done with bringing back CI to life.

which kind of tests you used

Functional test is not needed, we're mostly interested whether the stage produces correct query after usage. Something like https://github.com/doctrine/mongodb-odm/blob/2.4.x/tests/Doctrine/ODM/MongoDB/Tests/Aggregation/Stage/LookupTest.php or https://github.com/doctrine/mongodb-odm/blob/2.4.x/tests/Doctrine/ODM/MongoDB/Tests/Aggregation/Stage/CountTest.php :)

@malarzm
Copy link
Member

malarzm commented Sep 20, 2022

@Alaarafeh 2.5.x was just created, please start your work from there whenever you have a chance :)

@malarzm malarzm added the Hacktoberfest Good issue for participating in Hacktoberfest label Oct 3, 2022
@GromNaN
Copy link
Member

GromNaN commented Mar 9, 2023

There is 2 sides for this feature:

  1. Defining Atlas Search Indexes
  2. Add $search operators to the aggregation stages

@alcaeus
Copy link
Member

alcaeus commented Mar 28, 2023

#2516 adds the $search stage to the aggregation builder, along with almost all operators that the stage supports.

Defining Atlas Search index currently isn't possible through the driver, but only through the UI. The documentation will contain information on how to set up these indexes, but there is a project at MongoDB to expose search index creation to the drivers. I have no further information on the timeline of that yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature Hacktoberfest Good issue for participating in Hacktoberfest
Projects
None yet
Development

No branches or pull requests

4 participants