Skip to content

Commit aa84832

Browse files
committed
atlas search page
1 parent a388439 commit aa84832

File tree

3 files changed

+77
-2
lines changed

3 files changed

+77
-2
lines changed

source/atlas-search.txt

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
.. _kotlin-sync-atlas-search:
2+
3+
============
4+
Atlas Search
5+
============
6+
7+
.. facet::
8+
:name: genre
9+
:values: reference
10+
11+
.. meta::
12+
:keywords: full text, text analyzer, pipeline
13+
:description: Learn about how to use Atlas Search in the {+driver-long+}.
14+
15+
.. contents:: On this page
16+
:local:
17+
:backlinks: none
18+
:depth: 2
19+
:class: singlecol
20+
21+
Overview
22+
--------
23+
24+
In this guide, you can learn how to use the {+driver-short+} to
25+
run Atlas Search queries on a collection. Atlas Search enables you to perform
26+
full-text searches on collections hosted on MongoDB Atlas.
27+
28+
For more information about Atlas Search queries, see the :atlas:`Atlas Search
29+
documentation </atlas-search/>` in the Atlas manual.
30+
31+
Atlas search queries are different than traditional database queries, as they
32+
are intended to meet more general information needs. Where a database query must
33+
follow a strict syntax, search queries can be for simple text matching, but can
34+
also look for similar phrases, number or date ranges, or use regular expressions
35+
or wildcards. They rely on Atlas Search indexes to specify the behavior of the
36+
search and which fields to index.
37+
38+
For information about setting up indexes, see the :ref:`Atlas Search and Vector
39+
Search Indexes <kotlin-sync-atlas-search-index>` page.
40+
41+
Building Queries
42+
----------------
43+
44+
Atlas Search queries take the form of an aggregation pipeline stage. Atlas
45+
Search provides ``$search`` and ``$searchMeta`` stages, both of which must be the first
46+
stage in any query pipeline
47+
48+
For more information about pipelines in the {+driver-short+}, see the :ref:`kotlin-sync-aggregation`
49+
page.
50+
51+
For more information about Atlas pipeline stages, see the :atlas:`Choose the
52+
Aggregation Pipeline Stage </atlas-search/query-syntax/>`__ page in the Atlas
53+
manual.
54+
55+
.. sharedinclude:: dbx/jvm/atlas-search-operator-helpers.rst
56+
57+
.. replacement:: atlas-query-operators-example
58+
59+
.. code-block:: kotlin
60+
61+
Bson searchStageFilters = Aggregates.search(
62+
SearchOperator.compound()
63+
.filter(
64+
List.of(
65+
SearchOperator.text(fieldPath("genres"), "Drama"),
66+
SearchOperator.phrase(fieldPath("cast"), "sylvester stallone"),
67+
SearchOperator.numberRange(fieldPath("year")).gtLt(1980, 1989),
68+
SearchOperator.wildcard(fieldPath("title"),"Rocky *")
69+
)));
70+
71+
.. replacement:: searchoperator-interface-api-docs
72+
73+
the `SearchOperator Interface API documentation <{+core-api+}/com/mongodb/client/model/search/SearchOperator.html>`__
74+
75+

source/index.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
Specialized Data Formats </data-formats>
2424
Builders </builders>
2525
Run a Command </run-command>
26+
Atlas Search </atlas-search>
2627
Monitoring </monitoring>
2728
Security </security>
2829
In-Use Encryption </security/encrypt-fields>

source/whats-new.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,7 @@ and features:
4444

4545
.. replacement:: atlas-query-operators
4646

47-
the `SearchOperator <{+core-api+}/client/model/search/SearchOperator.html>`__
48-
interface API documentation
47+
the :ref:`Atlas Search <kotlin-sync-atlas-search>`
4948

5049
.. _kotlin-sync-version-5.3:
5150

0 commit comments

Comments
 (0)