Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rollup search endpoint fails on wildcard index pattern #34828

Closed
jen-huang opened this issue Oct 24, 2018 · 2 comments · Fixed by #34930
Closed

Rollup search endpoint fails on wildcard index pattern #34828

jen-huang opened this issue Oct 24, 2018 · 2 comments · Fixed by #34930
Labels
:StorageEngine/Rollup Turn fine-grained time-based data into coarser-grained data

Comments

@jen-huang
Copy link

I have defined a rollup job, ran it, and the rollup index is called jen-rollup.

Sending a search request request with the index name (GET jen-rollup/_rollup_search) directly returns correct results.

But sending the request with an asterisk at the end of the index name (GET jen-rollup*/_rollup_search) returns no results.

Per documentation, index can be Index, indices or index-pattern to execute a rollup search against. This can include both rollup and non-rollup indices. Docs also state Only one rollup index may be specified. If more than one are supplied an exception will be thrown.

Given these two criteria, I would expect that since jen-rollup* only matches one rollup index, querying it should give the same results as querying jen-rollup.

Example query that returns no results with *, but correct results without:

GET jen-rollup*/_rollup_search
{
  "aggs": {
    "2": {
      "date_histogram": {
        "field": "@timestamp",
        "interval": "60m",
        "time_zone": "UTC",
        "min_doc_count": 1
      }
    }
  },
  "size": 0,
  "_source": {
    "excludes": []
  },
  "stored_fields": [
    "*"
  ],
  "script_fields": {},
  "docvalue_fields": [
    {
      "field": "@timestamp",
      "format": "date_time"
    }
  ],
  "query": {
    "bool": {
      "must": [
        {
          "range": {
            "@timestamp": {
              "gte": 1539808778039,
              "lte": 1540413578039,
              "format": "epoch_millis"
            }
          }
        }
      ],
      "filter": [
        {
          "match_all": {}
        }
      ],
      "should": [],
      "must_not": []
    }
  }
}
@jen-huang
Copy link
Author

cc @cjcenizal @spalger @polyfractal

@jen-huang jen-huang added the :StorageEngine/Rollup Turn fine-grained time-based data into coarser-grained data label Oct 24, 2018
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-search-aggs

polyfractal added a commit to polyfractal/elasticsearch that referenced this issue Oct 26, 2018
This changes the RollupSearch endpoint to proactively resolve index
patterns.  If the index pattern(s) match more than one rollup index,
an exception is throw as before.  But if the pattern only matches one
rollup index, execution is allowed to continue (unlike before where
it would assume all patterns were for raw data).

Also tweaks the documentation to make this clear.

Closes elastic#34828
polyfractal added a commit that referenced this issue Oct 30, 2018
…34930)

This changes the RollupSearch endpoint to proactively resolve index
patterns.  If the index pattern(s) match more than one rollup index,
an exception is throw as before.  But if the pattern only matches one
rollup index, execution is allowed to continue (unlike before where
it would assume all patterns were for raw data).

This also allows the search endpoint to resolve aliases that point to
a rollup index.

Also tweaks the documentation to make this clear.

Closes #34828
polyfractal added a commit that referenced this issue Oct 30, 2018
…34930)

This changes the RollupSearch endpoint to proactively resolve index
patterns.  If the index pattern(s) match more than one rollup index,
an exception is throw as before.  But if the pattern only matches one
rollup index, execution is allowed to continue (unlike before where
it would assume all patterns were for raw data).

This also allows the search endpoint to resolve aliases that point to
a rollup index.

Also tweaks the documentation to make this clear.

Closes #34828
polyfractal added a commit that referenced this issue Oct 30, 2018
…34930)

This changes the RollupSearch endpoint to proactively resolve index
patterns.  If the index pattern(s) match more than one rollup index,
an exception is throw as before.  But if the pattern only matches one
rollup index, execution is allowed to continue (unlike before where
it would assume all patterns were for raw data).

This also allows the search endpoint to resolve aliases that point to
a rollup index.

Also tweaks the documentation to make this clear.

Closes #34828
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:StorageEngine/Rollup Turn fine-grained time-based data into coarser-grained data
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants