# Percolate: Document fields concatenating; causing unexpected matches

**URL:** <https://discuss.elastic.co/t/percolate-document-fields-concatenating-causing-unexpected-matches/10242>\
**Category:** Elasticsearch\
**Created:** [January 7, 2013, 1:22am UTC](https://discuss.elastic.co/t/percolate-document-fields-concatenating-causing-unexpected-matches/10242 "2013-01-07T01:22:36Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Brett\_Anderson](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/brett_anderson/32/2555_2.png) [@Brett\_Anderson](https://discuss.elastic.co/u/Brett_Anderson)\
**Post date:** [January 7, 2013, 1:22am UTC](https://discuss.elastic.co/t/percolate-document-fields-concatenating-causing-unexpected-matches/10242/1 "2013-01-07T01:22:36Z")

</div>

This is a re-post of a bug I raised at github about a month ago[https://github.com/elasticsearch/elasticsearch/issues/2476](https://github.com/elasticsearch/elasticsearch/issues/2476),  
but I haven't heard back about it.

To recreate the issue (against ES 0.20.0 RC1), please see this bash script:

> <https://gist.github.com/brett--anderson/4263982>

Basically a document with field1: A and field2: B will match against a  
percolator for the exact phrase "A B" even though that exact phrase does  
not occur in either field, but only when the fields are concatenated.

Just wondering if a fix for this is on any road map. Thanks.

--

---

<div class="post-metadata">

**Author:** ![Clinton\_Gormley](https://avatars.discourse-cdn.com/v4/letter/c/50afbb/32.png) [@Clinton\_Gormley](https://discuss.elastic.co/u/Clinton_Gormley)\
**Post date:** [January 7, 2013, 11:23am UTC](https://discuss.elastic.co/t/percolate-document-fields-concatenating-causing-unexpected-matches/10242/2 "2013-01-07T11:23:35Z")

</div>

On Sun, 2013-01-06 at 17:22 -0800, Laser Jesus wrote:

> This is a re-post of a bug I raised at github about a month ago, but I  
> haven't heard back about it.
> 
> To recreate the issue (against ES 0.20.0 RC1), please see this bash  
> script: [Bash script to recreate a bug in Elastic Search whereby separate document fields are merged together to create word combinations that don't actually exist in any individual field · GitHub](https://gist.github.com/4263982)
> 
> Basically a document with field1: A and field2: B will match against a  
> percolator for the exact phrase "A B" even though that exact phrase  
> does not occur in either field, but only when the fields are  
> concatenated.

The reason for this is that the values from field1 and field2 are being  
concatenated and indexed in the \_all field, which is what you are  
querying.

You have two choices:

1. query field1 and field2 separately, instead of the \_all field
2. set the position\_offset\_gap of the \_all field to (eg) 100

clint

--

---

<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:** [July 6, 2017, 2:57am UTC](https://discuss.elastic.co/t/percolate-document-fields-concatenating-causing-unexpected-matches/10242/3 "2017-07-06T02:57:34Z")

</div>

Closed on July 6, 2017, 2:57am UTC


