# Match financial transactions and merchants

**URL:** <https://discuss.elastic.co/t/match-financial-transactions-and-merchants/304588>\
**Category:** Elasticsearch\
**Created:** [May 12, 2022, 2:35pm UTC](https://discuss.elastic.co/t/match-financial-transactions-and-merchants/304588 "2022-05-12T14:35:58Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![fabiobozzo](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/fabiobozzo/32/105550_2.png) [@fabiobozzo](https://discuss.elastic.co/u/fabiobozzo)\
**Post date:** [May 12, 2022, 2:35pm UTC](https://discuss.elastic.co/t/match-financial-transactions-and-merchants/304588/1 "2022-05-12T14:35:58Z")

</div>

I have an Elastic index with billions of transactions.

An example tx:

```auto
{
   "id": "54bfa9af-009a-437d-bd21-caaf651f7218",
   "amount": 100.0, 
   "currency": "EUR",
   "type": "expense",
   ...
   "note": "CARD PAYMENT TO AZAMON.COM 100.0 EUR, RATE 0.86/GBP ON 05-05-2022"
}

```

I have a few millions merchants (companies, etc.) in a RDBMS table:

```auto
id | Name
123 | Azamon Ltd
456 | Alple Inc.
789 | Goooogle
...

```

I can easily ingest them in another Elastic index.

Now, both transaction's `note` and merchant's `name` are analyzed fields.

I would like, for every new transaction indexed, to enrich its content with a merchant ID+name. It doesn't have to be perfect, though. A threshold score could be fine tuned once the solution works for most of the matching tx.

e.g.

> for the tx above, I would like to obtain "123, Azamon Ltd" as a search result

Should I just create a custom tokenizer, analyzer for that, and run a query against a "merchants" index using the tx note as a search term? What would be a good pipeline structure for single-language tx/merchants matching?

Or is there a out-of-the box more efficient solution for that problem? I'm reading about NER, documents similarity and other stuff, but I can't figure out what's the best approach in my (simple) case.

Pointing me to relevant and proven doc pages will be considered an acceptable answer. TY

---

<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:** [June 9, 2022, 2:36pm UTC](https://discuss.elastic.co/t/match-financial-transactions-and-merchants/304588/2 "2022-06-09T14:36:56Z")

</div>

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