# Combine scores of two indexes with different mappings on a common field name

**URL:** <https://discuss.elastic.co/t/combine-scores-of-two-indexes-with-different-mappings-on-a-common-field-name/123496>\
**Category:** Elasticsearch\
**Created:** [March 12, 2018, 7:54am UTC](https://discuss.elastic.co/t/combine-scores-of-two-indexes-with-different-mappings-on-a-common-field-name/123496 "2018-03-12T07:54:52Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Arth](https://avatars.discourse-cdn.com/v4/letter/a/ba8739/32.png) [@Arth](https://discuss.elastic.co/u/Arth)\
**Post date:** [March 12, 2018, 7:54am UTC](https://discuss.elastic.co/t/combine-scores-of-two-indexes-with-different-mappings-on-a-common-field-name/123496/1 "2018-03-12T07:54:53Z")

</div>

Hi,

Is it possible to combine scores of two indexes with different mappings on a common field name ?

Thanks

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [March 12, 2018, 8:45am UTC](https://discuss.elastic.co/t/combine-scores-of-two-indexes-with-different-mappings-on-a-common-field-name/123496/2 "2018-03-12T08:45:39Z")

</div>

What do you mean by "combine"?

---

<div class="post-metadata">

**Author:** ![Arth](https://avatars.discourse-cdn.com/v4/letter/a/ba8739/32.png) [@Arth](https://discuss.elastic.co/u/Arth)\
**Post date:** [March 13, 2018, 10:18am UTC](https://discuss.elastic.co/t/combine-scores-of-two-indexes-with-different-mappings-on-a-common-field-name/123496/3 "2018-03-13T10:18:08Z")

</div>

I mean multiply or add in order to sort only one list of results (product ids).  
I'd like to make a search engine with an index with products infos (product id, title, description, category title, category description, ...) and another index with search history and tracking (searched text, nested results [product id, number of times clicked, number of times added to cart]. I'd like to search keywords making one multi search on these two indexes and get one list of products ids by combining scores from the two indexes.  
Sorry for broken english.

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [March 13, 2018, 10:33am UTC](https://discuss.elastic.co/t/combine-scores-of-two-indexes-with-different-mappings-on-a-common-field-name/123496/4 "2018-03-13T10:33:42Z")

</div>

You can't do join in elasticsearch. So you can't directly do that kind of thing with elasticsearch.

I'm sure @Mark_Harwood has plenty of ideas to solve that kind of use case though. Mark? 🙂

---

<div class="post-metadata">

**Author:** ![Mark\_Harwood](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mark_harwood/32/10538_2.png) [@Mark\_Harwood](https://discuss.elastic.co/u/Mark_Harwood)\
**Post date:** [March 13, 2018, 10:53am UTC](https://discuss.elastic.co/t/combine-scores-of-two-indexes-with-different-mappings-on-a-common-field-name/123496/5 "2018-03-13T10:53:48Z")

</div>

I've seen people attach popular search terms as an extra field on the documents for products that ultimately get clicked \*  
The measure of the volume of clicks can be expressed by repeating the search terms many times in the field so that Lucene's TF (term frequency) scoring will naturally boost any matches based on the level of repetition.

This text repetition can be wasteful so an interesting issue to keep eyes on is [this one](https://github.com/elastic/elasticsearch/issues/28803) where there is a proposal to allow a term to be expressed once but pass a number into Lucene to state how much repetition to (falsely) report there is for the term.

\* be careful how you use click data - remember there will be a bias towards people clicking on "page 1" search results.

---

<div class="post-metadata">

**Author:** ![Arth](https://avatars.discourse-cdn.com/v4/letter/a/ba8739/32.png) [@Arth](https://discuss.elastic.co/u/Arth)\
**Post date:** [March 13, 2018, 11:23am UTC](https://discuss.elastic.co/t/combine-scores-of-two-indexes-with-different-mappings-on-a-common-field-name/123496/6 "2018-03-13T11:23:26Z")

</div>

Thank you gentlemen 🙂

---

<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:** [April 10, 2018, 11:23am UTC](https://discuss.elastic.co/t/combine-scores-of-two-indexes-with-different-mappings-on-a-common-field-name/123496/7 "2018-04-10T11:23:39Z")

</div>

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