-
Notifications
You must be signed in to change notification settings - Fork 34
DOCSP-49622 Atlas Search #508
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
base: comp-cov
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for docs-golang ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
// Prints the results | ||
var results []bson.D | ||
if err = cursor.All(ctx, &results); err != nil { | ||
panic(err) | ||
} | ||
for _, result := range results { | ||
fmt.Println(result) | ||
} |
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.
For technical reviewer: My results are not printing, and I'm not sure why. Is this correct?
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.
The code looks good to me. I guess you have not set the search index. Just as mentioned in the "atlas-search.txt":
Before running an Atlas Search query, you must create an Atlas Search index
on your collection.
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.
It's strange that it's not printing because I do have an Atlas Search index on the title field! If nothing is wrong with this code, maybe there's something weird with how I'm creating the index on my end. I'll keep looking, thanks for checking!
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.
A few suggestions:
This section shows how to create an aggregation pipeline to run an | ||
Atlas Search query on a collection. In your array of pipeline stages, | ||
add the ``$search`` stage to specify the search criteria. Then, call | ||
the ``Aggregate()`` method and pass your pipeline array as a parameter. | ||
|
||
.. tip:: | ||
|
||
To learn more about aggregation operations, see the :ref:`golang-aggregation` | ||
guide. | ||
|
||
Before running an Atlas Search query, you must create an Atlas Search index | ||
on your collection. To learn how to programmatically create an Atlas Search | ||
index, see the :ref:`golang-atlas-search-indexes` section of the Indexes guide. |
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.
I think the first instruction after your intro line should be about creating indexes, rather than talking about the search stage.
You might want to massage this second paragraph a bit, but basically this:
This section shows how to create an aggregation pipeline to run an | |
Atlas Search query on a collection. In your array of pipeline stages, | |
add the ``$search`` stage to specify the search criteria. Then, call | |
the ``Aggregate()`` method and pass your pipeline array as a parameter. | |
.. tip:: | |
To learn more about aggregation operations, see the :ref:`golang-aggregation` | |
guide. | |
Before running an Atlas Search query, you must create an Atlas Search index | |
on your collection. To learn how to programmatically create an Atlas Search | |
index, see the :ref:`golang-atlas-search-indexes` section of the Indexes guide. | |
This section shows how to create an aggregation pipeline to run an | |
Atlas Search query on a collection. Before running an Atlas Search query, you must create an Atlas Search index | |
on your collection. To learn how to programmatically create an Atlas Search | |
index, see the :ref:`golang-atlas-search-indexes` section of the Indexes guide. | |
In your array of pipeline stages, | |
add the ``$search`` stage to specify the search criteria. Then, call | |
the ``Aggregate()`` method and pass your pipeline array as a parameter. | |
.. tip:: | |
To learn more about aggregation operations, see the :ref:`golang-aggregation` | |
guide. | |
---------------------- | ||
|
||
To learn more about Atlas Search, see :atlas:`Atlas Search </atlas-search/>` | ||
in the Atlas documentation. |
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.
I think you could also include a link specifically to the search operators page: https://www.mongodb.com/docs/atlas/atlas-search/operators-and-collectors/
Pull Request Info
PR Reviewing Guidelines
JIRA - https://jira.mongodb.org/browse/DOCSP-49622
Staging Links
https://deploy-preview-508--docs-golang.netlify.app/atlas-search/
Self-Review Checklist