# Wildcard in Path for Match Query

**URL:** <https://discuss.elastic.co/t/wildcard-in-path-for-match-query/78867>\
**Category:** Elasticsearch\
**Created:** [March 16, 2017, 1:18pm UTC](https://discuss.elastic.co/t/wildcard-in-path-for-match-query/78867 "2017-03-16T13:18:45Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![awanczowski](https://avatars.discourse-cdn.com/v4/letter/a/ad7895/32.png) [@awanczowski](https://discuss.elastic.co/u/awanczowski)\
**Post date:** [March 16, 2017, 1:18pm UTC](https://discuss.elastic.co/t/wildcard-in-path-for-match-query/78867/1 "2017-03-16T13:18:45Z")

</div>

I am looking to build a query filter in java for Elsaticsearch 5.2 to match any of the keywords wether they are author supplied or system generated. I am trying to do a wild card path but it does not return any results. I am using standard dynamic mapping in Elasticsearch.

```
{
    "content": {
        "title": "The History of Cats",
        "description": "A brief history of cats.",
        "keywords": {
            "author": ["cat"],
            "system": ["felis", "animalia"]
        }
    }
}

```

Ideally, if a user searches with the keyword cat or felis they should get a hit on this record. Currently, I do not receive any hits. Is this something that can be achieved through this query builder or another? Do I need to tweak mappings?

```
BoolQueryBuilder queryBuilder = QueryBuilders.boolQuery();
queryBuilder.filter(QueryBuilders.matchQuery("content.keywords.*", keyword));

SearchRequestBuilder searchRequestBuilder = this.client.prepareSearch("my-index")
                .setTypes("article")
                .setSearchType(SearchType.DFS_QUERY_THEN_FETCH)
                .setQuery(queryBuilder)
                .setFrom(0)
                .setSize(10)
                .addSort(SortBuilders.scoreSort());

SearchResponse searchResponse = searchRequestBuilder.execute().actionGet();

return searchResponse;

```

Thanks Drew

---

<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:** [April 13, 2017, 1:19pm UTC](https://discuss.elastic.co/t/wildcard-in-path-for-match-query/78867/2 "2017-04-13T13:19:13Z")

</div>

Closed on April 13, 2017, 1:19pm UTC

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