Skip to content

Commit

Permalink
Revert "Add Query String for rollups (#2428)"
Browse files Browse the repository at this point in the history
This reverts commit 8026b6d.
  • Loading branch information
vagimeli committed Jan 30, 2023
1 parent dfbf529 commit 27fc393
Showing 1 changed file with 1 addition and 52 deletions.
53 changes: 1 addition & 52 deletions _im-plugin/index-rollups/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -516,58 +516,7 @@ POST example_rollup/_search

## The doc_count field

The `doc_count` field in bucket aggregations contains the number of documents collected in each bucket. When calculating the bucket's `doc_count`, the number of documents is incremented by the number of the pre-aggregated documents in each summary document. The `doc_count` returned from rollup searches represents the total number of matching documents from the source index. The document count for each bucket is the same whether you search the source index or the rollup target index.

## Query string queries

To take advantage of shorter and easier to write strings in Query DSL, you can use [query strings]({{site.url}}{{site.baseurl}}/opensearch/query-dsl/query-string/) to simplify search queries in rollup indexes. To use query strings, add the following fields to your rollup search request.

```json
"query": {
"query_string": {
"query": "field_name:field_value"
}
}
```

The following example uses a query string with a `*` wildcard operator to search inside a rollup index called `my_server_logs_rollup`.

```json
GET my_server_logs_rollup/_search
{
"size": 0,
"query": {
"query_string": {
"query": "email* OR inventory",
"default_field": "service_name"
}
},

"aggs": {
"service_name": {
"terms": {
"field": "service_name"
},
"aggs": {
"region": {
"terms": {
"field": "region"
},
"aggs": {
"average quantity": {
"avg": {
"field": "cpu_usage"
}
}
}
}
}
}
}
}
```

For more information on which parameters are supported in query strings, see [Advanced filter options]({{site.url}}{{site.baseurl}}/opensearch/query-dsl/query-string/#parameters).
The `doc_count` field in bucket aggregations contains the number of documents collected in each bucket. When calculating the bucket's `doc_count`, the number of documents is incremented by the number of the pre-aggregated documents in each summary document. The `doc_count` returned from rollup searches represents the total number of matching documents from the source index. Thus, the document count for each bucket is the same whether you search the source index or the rollup target index.

## Dynamic target index

Expand Down

0 comments on commit 27fc393

Please sign in to comment.