# Enrich policy match using wildcard or fuzzy search

**URL:** <https://discuss.elastic.co/t/enrich-policy-match-using-wildcard-or-fuzzy-search/277374>\
**Category:** Elasticsearch\
**Created:** [June 29, 2021, 5:39pm UTC](https://discuss.elastic.co/t/enrich-policy-match-using-wildcard-or-fuzzy-search/277374 "2021-06-29T17:39:41Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![sam3546](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sam3546/32/79281_2.png) [@sam3546](https://discuss.elastic.co/u/sam3546)\
**Post date:** [June 29, 2021, 5:39pm UTC](https://discuss.elastic.co/t/enrich-policy-match-using-wildcard-or-fuzzy-search/277374/1 "2021-06-29T17:39:41Z")

</div>

I have an ingest pipeline with an enrich policy and separate index (index B)

Index B has entries that have a url and a number

For each document i ingest via the pipeline i want to match with an entry in index B and return the number and add it to the document being ingested.

the url on the document and the url in index B might not be a literal string such as:

Index - [https://www.google.co.uk](https://www.google.co.uk)  
Ingesting document - [www.google.co.uk](http://www.google.co.uk)

In the query field can i use a wildcard or fuzzy search?

```auto
{
    "match": {
        "indices": ["index_B"],
        "match_field": "url",
        "enrich_fields": ["number"],
        "query": {
            "wildcard": {
                "url": {
                    "value": "*url*"
                }
            }
        }
    }
}

```

---

<div class="post-metadata">

**Author:** ![sam3546](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sam3546/32/79281_2.png) [@sam3546](https://discuss.elastic.co/u/sam3546)\
**Post date:** [July 5, 2021, 11:45am UTC](https://discuss.elastic.co/t/enrich-policy-match-using-wildcard-or-fuzzy-search/277374/2 "2021-07-05T11:45:58Z")

</div>

After more digging this is not how the query field on the enrich processor works, it is used to filter the docs in the index to match against not to wildcard the string.

---

<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:** [August 2, 2021, 11:46am UTC](https://discuss.elastic.co/t/enrich-policy-match-using-wildcard-or-fuzzy-search/277374/3 "2021-08-02T11:46:42Z")

</div>

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