# Calculate the similarity between two fields same doc

**URL:** https://discuss.elastic.co/t/calculate-the-similarity-between-two-fields-same-doc/369000
**Category:** Elasticsearch
**Tags:** ingest-pipeline
**Created:** [October 17, 2024, 12:56pm UTC](https://discuss.elastic.co/t/calculate-the-similarity-between-two-fields-same-doc/369000 "2024-10-17T12:56:01Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![pereyrdi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pereyrdi/32/12480_2.png) [@pereyrdi](https://discuss.elastic.co/u/pereyrdi)
#### Post date: [October 17, 2024, 12:56pm UTC](https://discuss.elastic.co/t/calculate-the-similarity-between-two-fields-same-doc/369000/1 "2024-10-17T12:56:01Z")

</div>

Hello, I trying during log ingestion calculate the percentage of similarity between two fields. For example, A=foobar B=barfoor

I have read about this here: [similarity | Elasticsearch Guide [8.15] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/current/similarity.html)

But I dont knwo how apply it, maybe with a script processor in ingest-pipeline.

Thanks  
Diego
