# Search by newly added wildcard field to existing index

**URL:** https://discuss.elastic.co/t/search-by-newly-added-wildcard-field-to-existing-index/323122
**Category:** Elasticsearch
**Tags:** ingest-pipeline
**Created:** [January 13, 2023, 11:43am UTC](https://discuss.elastic.co/t/search-by-newly-added-wildcard-field-to-existing-index/323122 "2023-01-13T11:43:27Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![bkelastic](https://avatars.discourse-cdn.com/v4/letter/b/e9a140/32.png) [@bkelastic](https://discuss.elastic.co/u/bkelastic)
#### Post date: [January 13, 2023, 11:43am UTC](https://discuss.elastic.co/t/search-by-newly-added-wildcard-field-to-existing-index/323122/1 "2023-01-13T11:43:27Z")

</div>

I have in mappings

```auto
"fooField": {
          "type": "double"
        }

```

I want to search by this field using wildcard query, so I added wildcard multifield

```auto
"fooField": {
          "type": "double",
          "fields": {
            "wildcard": {
              "type": "wildcard"
            }
          }
        }

```

Searching by this field using the following query does not work until I execute \_update\_by\_query pipeline (to set the same value again what fixes searching by wildcard)

```auto
{
  "query": {
    "wildcard": {
      "fooField.wildcard": {
        "wildcard": "*150.23*",
        "boost": 1.0
      }
    }
  }
}

```

Create pipeline

```auto
PUT _ingest/pipeline/test-pipeline
{
  "processors": [
    {
      "set": {
        "field": "fooField",
        "value": "{{{fooField}}}",
        "ignore_empty_value": true
      }
    }
  ]
}

```

Call pipeline

```auto
POST some-index/_update_by_query?pipeline=test-pipeline&conflicts=proceed
{
    "query": {
        "match_all": {}
    }
}

```

Is this correct approach to such scenario?

---

<div class="post-metadata">

### Author: ![RabBit\_BR](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rabbit_br/32/82261_2.png) [@RabBit\_BR](https://discuss.elastic.co/u/RabBit_BR)
#### Post date: [January 13, 2023, 1:43pm UTC](https://discuss.elastic.co/t/search-by-newly-added-wildcard-field-to-existing-index/323122/2 "2023-01-13T13:43:16Z")

</div>

I see no problem with your approach. It's working for you and without any flaws.

Another option is to [reindex](https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-reindex.html#docs-reindex) the entire index in a new one. You would have 2 indexes and if the new one has some unexpected behavior you can go back to the old one. If everything is ok, you can remove the old one and use the new index.

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [February 10, 2023, 1:43pm UTC](https://discuss.elastic.co/t/search-by-newly-added-wildcard-field-to-existing-index/323122/3 "2023-02-10T13:43:23Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
