Skip to content

Commit 72be42d

Browse files
Document that _index is a virtual field and only supports term queries
Closes #15070 Closes #15081
1 parent 1685126 commit 72be42d

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

docs/reference/mapping/fields/index-field.asciidoc

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,17 @@
11
[[mapping-index-field]]
22
=== `_index` field
33

4-
When performing queries across multiple indexes, it is sometimes desirable
5-
to add query clauses that are associated with documents of only certain
6-
indexes. The `_index` field allows matching on the index a document was
7-
indexed into. Its value is accessible in queries, aggregations, scripts, and when sorting:
4+
When performing queries across multiple indexes, it is sometimes desirable to
5+
add query clauses that are associated with documents of only certain indexes.
6+
The `_index` field allows matching on the index a document was indexed into.
7+
Its value is accessible in `term`, or `terms` queries, aggregations,
8+
scripts, and when sorting:
9+
10+
NOTE: The `_index` is exposed as a virtual field -- it is not added to the
11+
Lucene index as a real field. This means that you can use the `_index` field
12+
in a `term` or `terms` query (or any query that is rewritten to a `term`
13+
query, such as the `match`, `query_string` or `simple_query_string` query),
14+
but it does not support `prefix`, `wildcard`, `regexp`, or `fuzzy` queries.
815

916
[source,js]
1017
--------------------------

0 commit comments

Comments
 (0)