# Contextual Search with History Documents

**URL:** https://discuss.elastic.co/t/contextual-search-with-history-documents/26708
**Category:** Elasticsearch
**Created:** [August 3, 2015, 7:52am UTC](https://discuss.elastic.co/t/contextual-search-with-history-documents/26708 "2015-08-03T07:52:28Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Matze](https://avatars.discourse-cdn.com/v4/letter/m/ba8739/32.png) [@Matze](https://discuss.elastic.co/u/Matze)
#### Post date: [August 3, 2015, 7:52am UTC](https://discuss.elastic.co/t/contextual-search-with-history-documents/26708/1 "2015-08-03T07:52:28Z")

</div>

Hello ES-People!

I'm quite new in ES and want to develop a contexutal search. It means that I want also introduce history datas in the search result.  
Use Case:  
On the one database, I have my Content with documents from creditors, debtors, accounts, cost areas and so on.  
On the other database I have my History with documents how often the (for example) creditor, debtors.. feature was already clicked.  
I don't want to save the history in the content documents, because I have always to update all (for example) creditor, when one of more thousands creditors is clicked.  
Therefore I want to join two documents (query to documents) and get a common score for these two documents.

Is there a way in ES to solve this?

Best regards,  
Matze

---

<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 5, 2017, 11:57pm UTC](https://discuss.elastic.co/t/contextual-search-with-history-documents/26708/2 "2017-07-05T23:57:47Z")

</div>


