# Function Score (gauss) on multiple indexes "unknown field" error

**URL:** <https://discuss.elastic.co/t/function-score-gauss-on-multiple-indexes-unknown-field-error/187910>\
**Category:** Elasticsearch\
**Created:** [June 27, 2019, 7:26pm UTC](https://discuss.elastic.co/t/function-score-gauss-on-multiple-indexes-unknown-field-error/187910 "2019-06-27T19:26:42Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bo\_Roth](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bo_roth/32/47678_2.png) [@Bo\_Roth](https://discuss.elastic.co/u/Bo_Roth)\
**Post date:** [June 27, 2019, 7:26pm UTC](https://discuss.elastic.co/t/function-score-gauss-on-multiple-indexes-unknown-field-error/187910/1 "2019-06-27T19:26:42Z")

</div>

On ElasticSearch 5.6

I'm running a multi-index query that uses the gauss function to score the resulting documents. The problem is that my indexes have different structures, so the geo\_points are in slightly different fields/paths.

On the first index, the geo\_point is in "locations.addresses.lat\_lon" (locations is a nested type, and addresses is just an object). On the second index, the geo\_point is in "addresses.lat\_lon" (addresses is a nested type - now that I think about it, I'm not sure why I did it that way).

As far as I can tell, there's no way to use something like "ignore\_unmapped" for function\_score or gauss queries. Do I have to change the structure of my second index? Or is there some way I can create aliases or something to allow the gauss function to get the right fields?

---

<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:** [July 1, 2019, 9:56am UTC](https://discuss.elastic.co/t/function-score-gauss-on-multiple-indexes-unknown-field-error/187910/2 "2019-07-01T09:56:23Z")

</div>

Hey,

your best bet would be to reindex your data here. Also upgrading might be an option, as since Elasticsearch 6.4 (IIRC) there is a feature called field aliases, see [https://www.elastic.co/guide/en/elasticsearch/reference/7.2/alias.html](https://www.elastic.co/guide/en/elasticsearch/reference/7.2/alias.html)

--Alex

---

<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 29, 2019, 9:56am UTC](https://discuss.elastic.co/t/function-score-gauss-on-multiple-indexes-unknown-field-error/187910/3 "2019-07-29T09:56:26Z")

</div>

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