-
Notifications
You must be signed in to change notification settings - Fork 14
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
(DOCSP-40808) Indexes > Atlas search indexes #64
(DOCSP-40808) Indexes > Atlas search indexes #64
Conversation
✅ Deploy Preview for docs-cpp ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
581be6b
to
a945666
Compare
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.
Really nice job! Some small suggestions on style (I didn't cite the Style Guide so let me know if you have any questions) and form. You can rerequest a review in GH when you're ready.
To get a ``search_index_view`` to your collection, | ||
call the ``search_indexes()`` method on your ``mongocxx::collection`` instance. |
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.
S: I'm not sure what a search_index_view is, and maybe for that reason, this sentence feels a little tacked on. It seems like this should be up before the "You can use the following methods..." paragraph, then you can segue into the methods available on it.
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.
Your comment made me realize that I never introduced how to connect to the database/collection, so I added a Sample Data section similar to what the Compound Indexes / Single Field Indexes pages have. This introduces how to connect to the database and also how to instantiate a search_index_view
. This allowed me to remove the line auto siv = collection.search_indexes();
from every code example and only include it in this beginning section. Hopefully this helps to introduce a search_index_view
more clearly!
If you think there's a more condensed way to organize the Sample Data section, I'm very open to suggestions!
- ``create_one()`` | ||
- ``create_many()`` | ||
- ``list()`` | ||
- ``update_one()`` | ||
- ``drop_one()`` |
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.
S: A list on its own like this probably isn't very useful. I would suggest:
- Making each list entry a link to its subsection below;
- Adding a short description to each list entry; or
- Both!
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.
Did both, let me know if you think this is an improvement!
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.
really nice! a few small suggestions and questions
To create a single Atlas Search Index on a collection, call the ``create_one()`` method on a ``mongocxx::search_index_view`` instance and pass in a ``mongoxcc::search_index_model`` | ||
instance specifying the Search index you want to create. | ||
|
||
A ``mongocxx::search_index_model`` instance requires the following fields: |
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.
That's helpful. if those arguments can (or should) be passed to the constructor, I would edit that line:
A ``mongocxx::search_index_model`` instance requires the following fields: | |
The ``mongocxx::search_index_model()`` constructor requires the following arguments: |
Use static mappings in your Atlas Search index to specify the fields you want to index and configure index options for individual fields. | ||
Use static mappings in your Atlas Search index to specify the fields that you want to index and configure index options for individual fields. | ||
|
||
To create a single Atlas Search index with static mappings, first create a ``definition`` document containing the ``mappings`` field. |
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.
Q: Do you use static mappings to create the index, or does the index contain/use them?
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 believe the index uses static mappings. I modeled this sentence after the following sentence from the Define Field Mappings page:
Use static mappings to configure index options for fields that you don't want indexed dynamically, or to configure a single field independently from others in an index.
But the same page also states that the index "uses" static / dynamic mappings:
You can configure an entire index to use dynamic mappings, ...
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.
Got it. The point of this is that the SG discourages "using" or "with", since they can be ambiguous (as here).
I would go with "index that uses static / dynamic mappings"
--------------------- | ||
|
||
To create a single Atlas Search Index on a collection, call the ``create_one()`` method on a ``mongocxx::search_index_view`` instance and pass in a ``mongoxcc::search_index_model`` | ||
instance specifying the Search index you want to create. |
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 so. I generally try to keep product names fully intact
- ``name``, a string specifying the name for your search index | ||
- ``definition``, a document containing the ``mappings`` field, which specifies how how to configure fields in your search index |
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 "field: description" is cleaner and clearer
I didn't know about avoiding articles; thanks for pointing this out
|
||
For a full list of fields you can configure in an Atlas Search index, see the :atlas:`Review Atlas Search Index Syntax </atlas-search/index-definitions/>` guide in the Atlas Search Documentation. | ||
|
||
After you create a Search index, you can perform Atlas Search queries on |
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.
fine to leave out
…example for atlas search indexes.
…s to index code examples file.
…a search index.
…ngle dynamic index.
…overed in the overview.
3395e11
to
6a2b30e
Compare
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.
LGTM after wording change with mappings!
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.
LGTM. Added minor comments.
* (DOCSP-40808) Added atlas page based on PHP docs. * (DOCSP-40808) Replace php command names with cpp * (DOCSP-40808) Edits. * (DOCSP-40808) Added copyable to examples in replace page, and edited example for atlas search indexes. * (DOCSP-40808) Edits. * (DOCSP-40808) Edits. * (DOCSP-40808) Edits. * (DOCSP-40808) Edits. * (DOCSP-40808) Edits. * (DOCSP-40808) Edits. * (DOCSP-40808) Edits. * (DOCSP-408088) Added multiple index example. * (DOCSP-40808) Pull changes to compound and single indexes, add changes to index code examples file. * (DOCSP-40808) Build error fixes. * (DOCSP-40808) Build error fixes. * (DOCSP-40808) Edits. * (DOCSP-40808) Reorganizing section introductions. * (DOCSP-40808) Reorganizing section introductions. * (DOCSP-40808) edits. * (DOCSP-40808) Added example for listing one search index. * (DOCSP-40808) Add examples for delete and update a search index. * (DOCPS-40808) Fixing build errors. * (DOCSP-40808) Reorganizing text. * (DOCSP-40808) Reorganizing text. * (DOCSP-40808) Reorganizing text. * (DOCSP-40808) Added API links * (DOCSP-40808) Output edit. * (DOCSP-40808) Updates. * (DOCSP-40808) Updates. * (DOCSP-40808) Fix page reference. * (DOCSP-40808) Breaking up the create an index section and adding text to indexes landing page. * (DOCSP-40808) Added code examples to indexes landing page. * (DOCSP-40808) Note to tip * (DOCSP-40808) De-wordi-fication. * (DOCSP-40808) Fix reference. * (DOCSP-40808) Replace delete with remove * (DOCSP-40808) Added note. * (DOCSP-40808) Add new links and reorganize. * (DOCSP-40808) Add new links and reorganize. * (DOCSP-40808) Added code comment. * (DOCSP-40808) Standardizing directions. * (DOCSP-40808) range based vs iterator * (DOCSP-40808) range-based * (DOCSP-40808) Edits. * (DOCSP-40808) Simplify the list indexes. * (DOCSP-40808) Error fix. * (DOCSP-40808) Note to important. * (DOCSP-40808) Edits. * (DOCSP-40808) Editing output. * (DOCSP-40808) Editing output. * (DOCSP-40808) Editing output. * (DOCSP-40808) Editing output. * (DOCSP-40808) Make output consistent. * (DOCSP-40808) Fix updated code. * (DOCSP-40808) Remove comments. * (DOCSP-40808) Fix build errors. * (DOCSP-40808) Edits. * (DOCSP-40808) Edits. * (DOCSP-40808) Fix code examples. * (DOCSP-40808) Edits. * (DOCSP-40808) Remove create multiple search indexes * (DOCSP-40808) Final edits. * (DOCSP-40808) @mongoKart Review changes. * (DOCSP-40808) @mongoKart Review edits: Adding more context to create a search index. * (DOCSP-40808) @mongoKart Review changes: more context for create a single dynamic index. * (DOCSP-40808) @mongoKart Replace all 'search index' with 'atlas search index' * (DOCSP-40808) @mongoKart Addressing feedback for create an index. * (DOCSP-40808) @mongoKart addressing feedback. * (DOCSP-40808) Addressing review feedback. * (DOCSP-40808) @mongoKart Feedback changes. * (DOCSP-40808) Removed text about Atlas Search Queries because it is covered in the overview. * (DOCSP-40808) @mongoKart Editing directions to create a new index. * (DOCSP-40808) Edit. * (DOCSP-40808) Link error fix. * (DOCSP-40808) @mongoKart reorganizing the create_one() directions. * (DOCSP-40808) Fix formatting in bulleted list. * (DOCSP-40808) Typo. * (DOCSP-40808) @mongoKart Addressing feedback. * (DOCSP-40808) @mongoKart Addressing feedback. * (DOCSP-40808) Fix ambiguous wording. * (DOCSP-40808) @kevinAlbs Review changes.
* (DOCSP-40808) Added atlas page based on PHP docs. * (DOCSP-40808) Replace php command names with cpp * (DOCSP-40808) Edits. * (DOCSP-40808) Added copyable to examples in replace page, and edited example for atlas search indexes. * (DOCSP-40808) Edits. * (DOCSP-40808) Edits. * (DOCSP-40808) Edits. * (DOCSP-40808) Edits. * (DOCSP-40808) Edits. * (DOCSP-40808) Edits. * (DOCSP-40808) Edits. * (DOCSP-408088) Added multiple index example. * (DOCSP-40808) Pull changes to compound and single indexes, add changes to index code examples file. * (DOCSP-40808) Build error fixes. * (DOCSP-40808) Build error fixes. * (DOCSP-40808) Edits. * (DOCSP-40808) Reorganizing section introductions. * (DOCSP-40808) Reorganizing section introductions. * (DOCSP-40808) edits. * (DOCSP-40808) Added example for listing one search index. * (DOCSP-40808) Add examples for delete and update a search index. * (DOCPS-40808) Fixing build errors. * (DOCSP-40808) Reorganizing text. * (DOCSP-40808) Reorganizing text. * (DOCSP-40808) Reorganizing text. * (DOCSP-40808) Added API links * (DOCSP-40808) Output edit. * (DOCSP-40808) Updates. * (DOCSP-40808) Updates. * (DOCSP-40808) Fix page reference. * (DOCSP-40808) Breaking up the create an index section and adding text to indexes landing page. * (DOCSP-40808) Added code examples to indexes landing page. * (DOCSP-40808) Note to tip * (DOCSP-40808) De-wordi-fication. * (DOCSP-40808) Fix reference. * (DOCSP-40808) Replace delete with remove * (DOCSP-40808) Added note. * (DOCSP-40808) Add new links and reorganize. * (DOCSP-40808) Add new links and reorganize. * (DOCSP-40808) Added code comment. * (DOCSP-40808) Standardizing directions. * (DOCSP-40808) range based vs iterator * (DOCSP-40808) range-based * (DOCSP-40808) Edits. * (DOCSP-40808) Simplify the list indexes. * (DOCSP-40808) Error fix. * (DOCSP-40808) Note to important. * (DOCSP-40808) Edits. * (DOCSP-40808) Editing output. * (DOCSP-40808) Editing output. * (DOCSP-40808) Editing output. * (DOCSP-40808) Editing output. * (DOCSP-40808) Make output consistent. * (DOCSP-40808) Fix updated code. * (DOCSP-40808) Remove comments. * (DOCSP-40808) Fix build errors. * (DOCSP-40808) Edits. * (DOCSP-40808) Edits. * (DOCSP-40808) Fix code examples. * (DOCSP-40808) Edits. * (DOCSP-40808) Remove create multiple search indexes * (DOCSP-40808) Final edits. * (DOCSP-40808) @mongoKart Review changes. * (DOCSP-40808) @mongoKart Review edits: Adding more context to create a search index. * (DOCSP-40808) @mongoKart Review changes: more context for create a single dynamic index. * (DOCSP-40808) @mongoKart Replace all 'search index' with 'atlas search index' * (DOCSP-40808) @mongoKart Addressing feedback for create an index. * (DOCSP-40808) @mongoKart addressing feedback. * (DOCSP-40808) Addressing review feedback. * (DOCSP-40808) @mongoKart Feedback changes. * (DOCSP-40808) Removed text about Atlas Search Queries because it is covered in the overview. * (DOCSP-40808) @mongoKart Editing directions to create a new index. * (DOCSP-40808) Edit. * (DOCSP-40808) Link error fix. * (DOCSP-40808) @mongoKart reorganizing the create_one() directions. * (DOCSP-40808) Fix formatting in bulleted list. * (DOCSP-40808) Typo. * (DOCSP-40808) @mongoKart Addressing feedback. * (DOCSP-40808) @mongoKart Addressing feedback. * (DOCSP-40808) Fix ambiguous wording. * (DOCSP-40808) @kevinAlbs Review changes.
Adds documentation for Atlas Search Indexes. Adds Atlas Search Index Management section to Optimize Queries with Indexes page. Adds link to Atlas Search Indexes page to Work with Indexes page. Adds Atlas Search Indexes guide to documentation.
PR Reviewing Guidelines
JIRA - https://jira.mongodb.org/browse/DOCSP-40808
Staging -
Self-Review Checklist