# Exact match against long queries

**URL:** <https://discuss.elastic.co/t/exact-match-against-long-queries/165102>\
**Category:** Elasticsearch\
**Created:** [January 21, 2019, 5:38pm UTC](https://discuss.elastic.co/t/exact-match-against-long-queries/165102 "2019-01-21T17:38:38Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![magroski\_tfy](https://avatars.discourse-cdn.com/v4/letter/m/94ad74/32.png) [@magroski\_tfy](https://discuss.elastic.co/u/magroski_tfy)\
**Post date:** [January 21, 2019, 5:38pm UTC](https://discuss.elastic.co/t/exact-match-against-long-queries/165102/1 "2019-01-21T17:38:38Z")

</div>

I'm trying to use Elasticsearch in a situation similar to a reverse search, but I'm having trouble finding the right approach.

My objective is to find exact requirements inside a long query string.

Example:

My Indexed documents:

- must be faster than 50mph
- must jump higher than a tree
- be able to stand on two feet

My query:

> "We are looking for an animal that must be able to stand on two feet, also must jump higher than a tree, and should be faster than 40mph, and has white and red stripes with wings"

What results I expect (exact matches, case insentitive):

- be able to stand on two feet
- must jump higher than a tree

What results I am getting (partial matches):

- be able to stand on two feet
- must jump higher than a tree
- must **be faster than** 50mph

I've tried shingles and percolate, but no success.  
Anyone have any pointers?

---

<div class="post-metadata">

**Author:** ![magroski\_tfy](https://avatars.discourse-cdn.com/v4/letter/m/94ad74/32.png) [@magroski\_tfy](https://discuss.elastic.co/u/magroski_tfy)\
**Post date:** [January 29, 2019, 11:22am UTC](https://discuss.elastic.co/t/exact-match-against-long-queries/165102/2 "2019-01-29T11:22:55Z")

</div>

For anyone that comes across this issue on the future:  
The documentation is not very clear, but the type of query that you store on the percolator index has a direct impact on the result. So, if you want full match, you can store a "match\_phrase" query.

ES 6.5

---

<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 26, 2019, 11:24am UTC](https://discuss.elastic.co/t/exact-match-against-long-queries/165102/3 "2019-02-26T11:24:47Z")

</div>

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