Merge pull request #483 from rursprung/add-partial-tlq-documentation

Add Basic Documentation for Terms Lookup Query
This commit is contained in:
Alice Williams 2022-05-09 08:54:27 -07:00 committed by GitHub
commit a150b18a2a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 27 additions and 0 deletions

View File

@ -265,6 +265,33 @@ GET shakespeare/_search
You get back documents that match any of the terms. You get back documents that match any of the terms.
### Terms Lookup
You can use a `terms` query with a `lookup` to match values based on a field in a document in another index.
Parameter | Behavior
:--- | :---
`index` | The index from which the document is read.
`id` | The id of the documented.
`path` | Path to the field from which the values are used in the terms query.
E.g. to get all lines from the shakespeare play for a role (or roles) specified in the index `play-assignments` for the entry `42`:
```json
GET shakespeare/_search
{
"query": {
"terms": {
"speaker": {
"index": "play-assignments",
"id": "42",
"path": "role"
}
}
}
}
```
## IDs ## IDs
Use the `ids` query to search for one or more document ID values. Use the `ids` query to search for one or more document ID values.