# Matching receipts with fulfilled orders

**URL:** <https://discuss.elastic.co/t/matching-receipts-with-fulfilled-orders/282123>\
**Category:** Elasticsearch\
**Created:** [August 20, 2021, 11:19pm UTC](https://discuss.elastic.co/t/matching-receipts-with-fulfilled-orders/282123 "2021-08-20T23:19:48Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![JoeGilkey](https://avatars.discourse-cdn.com/v4/letter/j/ce73a5/32.png) [@JoeGilkey](https://discuss.elastic.co/u/JoeGilkey)\
**Post date:** [August 20, 2021, 11:19pm UTC](https://discuss.elastic.co/t/matching-receipts-with-fulfilled-orders/282123/1 "2021-08-20T23:19:48Z")

</div>

Hello,  
I have a data stream that I am posting grocery receipts to on an hourly basis. The receipt includes the individual items purchased, as well as a keyword array with the unique product UPC codes. I’m trying to match these receipts up against online shopping receipts (I.e. InstaCart). Their receipts don’t always have the items on the sales receipts, there are occasionally substitutions and the store isn’t always correct. I know I should get multiple results back if there is discrepancies. If I run a Boolean Must query, I only get entries when there is a 100% match. If I run a Boolean Should query, I’m getting a lot of false matches. Does anyone have a suggestion on a better way of matching this up?

Thank you,  
Joe

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [August 25, 2021, 9:50am UTC](https://discuss.elastic.co/t/matching-receipts-with-fulfilled-orders/282123/2 "2021-08-25T09:50:06Z")

</div>

Check out the [minimum\_should\_match parameter](https://www.elastic.co/guide/en/elasticsearch/reference/7.14/query-dsl-minimum-should-match.html) that is supported in some queries (like match and bool) - that might help you.

Otherwise a minimal but reproducible example might help to understand the full context!

---

<div class="post-metadata">

**Author:** ![JoeGilkey](https://avatars.discourse-cdn.com/v4/letter/j/ce73a5/32.png) [@JoeGilkey](https://discuss.elastic.co/u/JoeGilkey)\
**Post date:** [August 25, 2021, 10:05pm UTC](https://discuss.elastic.co/t/matching-receipts-with-fulfilled-orders/282123/3 "2021-08-25T22:05:49Z")

</div>

Thank you, I will try that tomorrow and post an update with an example.

---

<div class="post-metadata">

**Author:** ![JoeGilkey](https://avatars.discourse-cdn.com/v4/letter/j/ce73a5/32.png) [@JoeGilkey](https://discuss.elastic.co/u/JoeGilkey)\
**Post date:** [August 29, 2021, 3:43pm UTC](https://discuss.elastic.co/t/matching-receipts-with-fulfilled-orders/282123/4 "2021-08-29T15:43:17Z")

</div>

Thank you for the help. Your search improved the results, but I also found the source data I was using for the matching was faulted. Some had check digits, some didn’t.

---

<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 26, 2021, 3:43pm UTC](https://discuss.elastic.co/t/matching-receipts-with-fulfilled-orders/282123/5 "2021-09-26T15:43:33Z")

</div>

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