# AND Match All Tokens in Any Order

**URL:** https://discuss.elastic.co/t/and-match-all-tokens-in-any-order/166469
**Category:** Elasticsearch
**Created:** [January 31, 2019, 5:24am UTC](https://discuss.elastic.co/t/and-match-all-tokens-in-any-order/166469 "2019-01-31T05:24:18Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![tlovett1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tlovett1/32/13950_2.png) [@tlovett1](https://discuss.elastic.co/u/tlovett1)
#### Post date: [January 31, 2019, 5:24am UTC](https://discuss.elastic.co/t/and-match-all-tokens-in-any-order/166469/1 "2019-01-31T05:24:18Z")

</div>

Hello,

I am trying to match query a text field. However, I only want the match to count if the analyzed query has the same number of tokens as the searched field. For example:

"one two three" would match "two three one" but not "two three one four"

Anyone have any ideas?

Thanks

---

<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 28, 2019, 5:24am UTC](https://discuss.elastic.co/t/and-match-all-tokens-in-any-order/166469/2 "2019-02-28T05:24:23Z")

</div>

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