Skip to content

Regexp on the _index does not work in 2.0 #15070

@gmoskovicz

Description

@gmoskovicz

Currently, some queries work on the special _index field, as an example:

  • Input
POST trial/doc
{
  "text": "this is text"
}

GET trial/_search
{
  "query": {
    "filtered": {
      "filter": {
        "term": {
          "_index": "trial"
        }
      }
    }
  }
}
  • Response
{
  "took": 1,
  "timed_out": false,
  "_shards": {
    "total": 5,
    "successful": 5,
    "failed": 0
  },
  "hits": {
    "total": 1,
    "max_score": 1,
    "hits": [
      {
        "_index": "trial",
        "_type": "doc",
        "_id": "AVFKXPURmqplIqGCgb_z",
        "_score": 1,
        "_source": {
          "text": "this is text"
        }
      }
    ]
  }
}

However, wildcards are not supported for querying this field:

  • Input
GET trial/_search
{
  "query": {
    "filtered": {
      "filter": {
        "regexp": {
          "_index": "tri*"
        }
      }
    }
  }
}
  • Response (No results)
{
  "took": 2,
  "timed_out": false,
  "_shards": {
    "total": 5,
    "successful": 5,
    "failed": 0
  },
  "hits": {
    "total": 0,
    "max_score": null,
    "hits": []
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    :Search/SearchSearch-related issues that do not fall into other categories>docsGeneral docs changes

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions