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

(DOCSP-40808) Indexes > Atlas search indexes #64

Merged
merged 81 commits into from
Nov 8, 2024

Conversation

elyse-mdb
Copy link
Collaborator

@elyse-mdb elyse-mdb commented Oct 25, 2024

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

  • Is this free of any warnings or errors in the RST?
  • Did you run a spell-check?
  • Did you run a grammar-check?
  • Are all the links working?
  • Are the facets and meta keywords accurate?

Copy link

netlify bot commented Oct 25, 2024

Deploy Preview for docs-cpp ready!

Name Link
🔨 Latest commit 8a66ab3
🔍 Latest deploy log https://app.netlify.com/sites/docs-cpp/deploys/672e62c80a038c0008941a82
😎 Deploy Preview https://deploy-preview-64--docs-cpp.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@elyse-mdb elyse-mdb force-pushed the DOCSP-40808-atlasSearchIndexes branch 2 times, most recently from 581be6b to a945666 Compare November 4, 2024 14:36
Copy link
Collaborator

@mongoKart mongoKart left a 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.

source/indexes.txt Outdated Show resolved Hide resolved
source/indexes/atlas-search-index.txt Outdated Show resolved Hide resolved
source/indexes/atlas-search-index.txt Outdated Show resolved Hide resolved
Comment on lines 40 to 41
To get a ``search_index_view`` to your collection,
call the ``search_indexes()`` method on your ``mongocxx::collection`` instance.
Copy link
Collaborator

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.

Copy link
Collaborator Author

@elyse-mdb elyse-mdb Nov 6, 2024

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!

Comment on lines 34 to 38
- ``create_one()``
- ``create_many()``
- ``list()``
- ``update_one()``
- ``drop_one()``
Copy link
Collaborator

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!

Copy link
Collaborator Author

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!

source/indexes/atlas-search-index.txt Outdated Show resolved Hide resolved
source/indexes/atlas-search-index.txt Outdated Show resolved Hide resolved
source/indexes/atlas-search-index.txt Outdated Show resolved Hide resolved
source/indexes/atlas-search-index.txt Outdated Show resolved Hide resolved
source/read/retrieve.txt Outdated Show resolved Hide resolved
@elyse-mdb elyse-mdb requested a review from mongoKart November 7, 2024 16:26
Copy link
Collaborator

@mongoKart mongoKart left a 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:
Copy link
Collaborator

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:

Suggested change
A ``mongocxx::search_index_model`` instance requires the following fields:
The ``mongocxx::search_index_model()`` constructor requires the following arguments:

source/indexes/atlas-search-index.txt Outdated Show resolved Hide resolved
source/indexes/atlas-search-index.txt Outdated Show resolved Hide resolved
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.
Copy link
Collaborator

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?

Copy link
Collaborator Author

@elyse-mdb elyse-mdb Nov 7, 2024

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, ...

Copy link
Collaborator

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"

source/indexes/atlas-search-index.txt Outdated Show resolved Hide resolved
source/indexes/atlas-search-index.txt Outdated Show resolved Hide resolved
source/indexes/atlas-search-index.txt Outdated Show resolved Hide resolved
---------------------

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.
Copy link
Collaborator

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

Comment on lines 63 to 64
- ``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
Copy link
Collaborator

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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fine to leave out

@elyse-mdb elyse-mdb force-pushed the DOCSP-40808-atlasSearchIndexes branch from 3395e11 to 6a2b30e Compare November 7, 2024 21:58
@elyse-mdb elyse-mdb requested a review from mongoKart November 7, 2024 22:19
Copy link
Collaborator

@mongoKart mongoKart left a 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!

@elyse-mdb elyse-mdb requested a review from kevinAlbs November 8, 2024 16:56
Copy link
Collaborator

@kevinAlbs kevinAlbs left a 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.

source/includes/usage-examples/index-code-examples.cpp Outdated Show resolved Hide resolved
source/includes/indexes/indexes.cpp Outdated Show resolved Hide resolved
@elyse-mdb elyse-mdb merged commit 1f1bfeb into mongodb:master Nov 8, 2024
4 of 5 checks passed
@elyse-mdb elyse-mdb deleted the DOCSP-40808-atlasSearchIndexes branch November 8, 2024 19:22
elyse-mdb added a commit to elyse-mdb/docs-cpp that referenced this pull request Nov 8, 2024
* (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.
elyse-mdb added a commit that referenced this pull request Nov 8, 2024
* (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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants