# Update mapping and search on fields by wildcards

**URL:** https://discuss.elastic.co/t/update-mapping-and-search-on-fields-by-wildcards/227982
**Category:** Elasticsearch
**Created:** [April 14, 2020, 7:05pm UTC](https://discuss.elastic.co/t/update-mapping-and-search-on-fields-by-wildcards/227982 "2020-04-14T19:05:05Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Behzad\_Rezaie](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/behzad_rezaie/32/48588_2.png) [@Behzad\_Rezaie](https://discuss.elastic.co/u/Behzad_Rezaie)
#### Post date: [April 14, 2020, 7:05pm UTC](https://discuss.elastic.co/t/update-mapping-and-search-on-fields-by-wildcards/227982/1 "2020-04-14T19:05:05Z")

</div>

Hi pals,

I am using the APM. I have added the fields `context.request.body` and `context.response.body` to the indices in the .Net Core version (since the version I was using was not set for these fields, I added them myself, due to emergency). Unfortunately, I could not search on them, thus, updated the mapping. The mapping before I update it, was like (I have reduced many parts):

```auto
{
	"apm-6.5.4-metric-2020.03.15": {
		"mappings": {
			"doc": {
				"_meta": {
					"version": "6.5.4"
				},
				"properties": {
					"@timestamp": {
						"type": "date"
					},
					"context": {
						"dynamic": "false",
						"properties": {
							"request": {
								"properties": {
									"http_version": {
										"type": "keyword",
										"ignore_above": 1024
									},
									"method": {
										"type": "keyword",
										"ignore_above": 1024
									},
									"url": {
										"properties": {
											"full": {
												"type": "keyword",
												"ignore_above": 1024
											},
											"pathname": {
												"type": "keyword",
												"ignore_above": 1024
											}
										}
									}
								}
							},
							"response": {
								"properties": {
									"finished": {
										"type": "boolean"
									},
									"status_code": {
										"type": "long"
									}
								}
							}
							.
							.
							.
						}
					}
				}
			}
		}
	}
}

```

Then I added the following:

```auto
PUT /apm-6.5.4-transaction-2020.04.06/_mapping/doc
{
	"properties": {
		"context": {
			"type": "object",
			"properties": {
				"response": {
					"type": "object",
					"properties": {
						"body": {
							"type": "text"
						}
					}
				}
			}
		}
	}
}

```

and

```auto
PUT /apm-6.5.4-transaction-2020.04.06/_mapping/doc
{
	"properties": {
		"context": {
			"type": "object",
			"properties": {
				"request": {
					"type": "object",
					"properties": {
						"body": {
							"type": "text"
						}
					}
				}
			}
		}
	}
}

```

Then I refreshed the field list in Kibana.  
Now, I want to search on the `context.request.body` or `context.request.request`, but I receive no result. A sample of the data in the index for `context.request.request` is

```auto
context.request.request:
{
	"id": "some guid", "user": {"id": "some guid", "firstname": "john", "lasname": "smith"},
}

```

The following is a sample of my query:

```auto
{
  "query": {
    "wildcard": {
      "context.request.body": {
        "value": "*john*"
      }
    }
  }
}

```

Could you please help me to edit my mapping or my query?! What is the problem?

---

<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: [May 12, 2020, 7:05pm UTC](https://discuss.elastic.co/t/update-mapping-and-search-on-fields-by-wildcards/227982/2 "2020-05-12T19:05:09Z")

</div>

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