On this page
This tutorial describes how to create an index on the
listingsAndReviews collection in the
and run a query that returns documents with the
for each property within the specified polygon defined using
This tutorial takes you through the following steps:
Set up an Atlas Search index on the
addressfield in the
Run a query that returns 10 documents with the
property_typeof each property within the specified geographic
coordinates. Atlas Search results reflect a preference for properties of type
condominium, and each document in the result is assigned a relevance
score, returned in order from highest to lowest.
Before you begin, ensure that your Atlas cluster meets the requirements described in the Prerequisites.
To create an Atlas Search index, you must have
Project Data Access Admin or higher access to the project.
In this section, you will create an Atlas Search index on the
If it is not already displayed, select the organization that contains your desired project from the Organizations menu in the navigation bar.
If it is not already displayed, select your desired project from the Projects menu in the navigation bar.
Click your cluster's name.
Click the Search tab.
In the Index Name field, enter
If you name your index
default, you don't need to specify an
indexparameter when using the $search pipeline stage. Otherwise, you must specify the index name using the
In the Database and Collection section, find the
sample_airbnbdatabase, and select the
You can use the Visual Editor or the JSON Editor in the Atlas user interface to create the index. The following index definition specifies that Atlas Search must index:
All of the fields in the collection automatically.
address.locationfield of a
➤ Use the Select your language drop-down menu on this page to set the language of the examples in this section.
In this section, you will run a query that returns 10 documents with the
for each property within the specified
A field specifying each documents
score is also returned,
and results are ordered with a preference for
properties of type