Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions _query-dsl/geo-and-xy/geoshape.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@ Relation | Description | Supporting geographic field type

## Defining the shape in a geoshape query

You can define the shape to filter documents in a geoshape query either by providing a new shape definition at query time or by referencing the name of a shape pre-indexed in another index.
You can define the shape to filter documents in a geoshape query either by [providing a new shape definition at query time](#using-a-new-shape-definition) or by [referencing the name of a shape pre-indexed in another index](#using-a-pre-indexed-shape-definition).

### Using a new shape definition
## Using a new shape definition

To provide a new shape to a geoshape query, define it in the `geo_shape` field. You must define the geoshape in [GeoJSON format](https://geojson.org/).

The following example illustrates searching for documents containing geoshapes that match a geoshape defined at query time.

#### Step 1: Create an index
### Step 1: Create an index

First, create an index and map the `location` field as a `geo_shape`:

Expand Down Expand Up @@ -422,7 +422,7 @@ GET /testindex/_search
Geoshape queries whose geometry collection contains a linestring or a multilinestring do not support the `WITHIN` relation.
{: .note}

### Using a pre-indexed shape definition
## Using a pre-indexed shape definition

When constructing a geoshape query, you can also reference the name of a shape pre-indexed in another index. Using this method, you can define a geoshape at index time and refer to it by name at search time.

Expand Down
Loading