# Match long query text to short field

**URL:** https://discuss.elastic.co/t/match-long-query-text-to-short-field/144584
**Category:** Elasticsearch
**Created:** [August 15, 2018, 7:55pm UTC](https://discuss.elastic.co/t/match-long-query-text-to-short-field/144584 "2018-08-15T19:55:28Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![dmill](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dmill/32/34514_2.png) [@dmill](https://discuss.elastic.co/u/dmill)
#### Post date: [August 15, 2018, 7:55pm UTC](https://discuss.elastic.co/t/match-long-query-text-to-short-field/144584/1 "2018-08-15T19:55:28Z")

</div>

Standard match involves providing a small query term or phrase and matching it against a larger blob of text stored in a document. I want to do the reverse - my query will be a large blob of text, like a paragraph, and I want to rank the relevance of documents that contain a full name (i.e. John Smith). I want to supply a paragraph and determine which document's full name is most likely to be contained in that paragraph. What's the best way to do this?

---

<div class="post-metadata">

### Author: ![dmill](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dmill/32/34514_2.png) [@dmill](https://discuss.elastic.co/u/dmill)
#### Post date: [August 16, 2018, 12:17am UTC](https://discuss.elastic.co/t/match-long-query-text-to-short-field/144584/2 "2018-08-16T00:17:37Z")

</div>

Answering my own question: The Percolate API allows you to store queries and run documents against them: [https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-percolate-query.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-percolate-query.html)

---

<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: [September 13, 2018, 12:17am UTC](https://discuss.elastic.co/t/match-long-query-text-to-short-field/144584/3 "2018-09-13T00:17:41Z")

</div>

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