-
Notifications
You must be signed in to change notification settings - Fork 24
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-28393 C# new atlas search examples #521
Open
shuangela
wants to merge
7
commits into
mongodb:master
Choose a base branch
from
shuangela:DOCSP-28393-advanced-atlas-search-methods
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+138
−6
Open
Changes from 1 commit
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
7dd0258
new atlas search examples
shuangela 245c7ba
fix link
shuangela 340a215
fix link
shuangela b27afa0
add details
shuangela 5ac354f
small fixes
shuangela b1fc9b3
sa edits
shuangela 7ee831f
sa edit
shuangela File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -256,17 +256,17 @@ Facet | |||||
Use the ``Facet()`` method to group results by values or ranges in the specified faceted fields | ||||||
and return the count for each of those groups. | ||||||
|
||||||
You can use ``Facet()`` with both the ``$search`` and ``$searchMeta`` stages. MongoDB recommends using | ||||||
You can use the ``Facet()`` method with both the ``$search`` and ``$searchMeta`` stages. MongoDB recommends using | ||||||
facet with the ``$searchMeta`` stage to retrieve metadata results only for the query. | ||||||
To retrieve metadata results and query results using the ``$search`` stage, you must use the | ||||||
``$$SEARCH_META`` aggregation variable. See :atlas:`SEARCH_META Aggregation Variable </atlas-search/facet/#std-label-fts-facet-aggregation-variable>` to learn more. | ||||||
``$$SEARCH_META`` aggregation variable. To learn more about this variable, see the :atlas:`SEARCH_META Aggregation Variable </atlas-search/facet/#std-label-fts-facet-aggregation-variable>` Atlas guide. | ||||||
|
||||||
The following limitations apply: | ||||||
|
||||||
- You can run facet queries on a single field only. You can't run facet queries on groups of fields. | ||||||
- You can run facet queries over sharded collections on clusters running MongoDB v6.0 only. | ||||||
|
||||||
The following example searches searches the ``guitars`` collection for any documents in | ||||||
The following example searches the ``guitars`` collection for any documents in | ||||||
which the value of the ``in_stock`` field is ``true``. The query uses the ``Facet()`` method to process the input documents, with a maximum number of ``100`` facet categories to return in the results. The query returns the total count of documents in which the value of ``in_stock`` is ``true``. | ||||||
|
||||||
.. literalinclude:: /includes/fundamentals/code-examples/atlas-search/AtlasSearchExamples.cs | ||||||
|
@@ -723,21 +723,15 @@ Search Multiple Fields | |||||
|
||||||
The ``path`` parameter is used by the Atlas Search | ||||||
:atlas:`operators </atlas-search/query-syntax>` to specify the field or fields | ||||||
to be searched. It may contain: | ||||||
|
||||||
- A string | ||||||
- An array of strings | ||||||
- A :atlas:`multi analyzer </atlas-search/analyzers/multi>` specification | ||||||
- An array containing a combination of strings and multi analyzer | ||||||
specifications | ||||||
to be searched. To learn more about what the ``path`` parameter may contain, see :atlas:`Construct a Query Path </atlas-search/path-construction>` in the Atlas guide. | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [s] Can potentially shorten to:
Suggested change
|
||||||
|
||||||
.. note:: | ||||||
|
||||||
Not all operators can use all the different types of paths. See the | ||||||
documentation for each individual operator for details on what types | ||||||
of path it supports. | ||||||
|
||||||
To search multiple indexed fields, use the ``Multi()`` method and pass in your fields. Documents which match on any of the specified fields are included in the result set. The following example searches the description and type fields. | ||||||
To search multiple indexed fields, use the ``Multi()`` method and pass in your fields. Documents which match on any of the specified fields are included in the result set. | ||||||
|
||||||
The following example searches for the string ``classic`` in either the ``make`` or the ``description`` field. | ||||||
|
||||||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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] Curious why the examples throughout this doc (not just in the diff) don't just use the io codeblock which is a bit cleaner? Or at least set copyable to
false
for the output maybe?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 am also not sure because this is my first c# pr! I just followed the standard convention/what the rest of the examples had.