# Creating custom search result by mapping query to a specific doc

**URL:** <https://discuss.elastic.co/t/creating-custom-search-result-by-mapping-query-to-a-specific-doc/84629>\
**Category:** Elasticsearch\
**Created:** [May 4, 2017, 8:52pm UTC](https://discuss.elastic.co/t/creating-custom-search-result-by-mapping-query-to-a-specific-doc/84629 "2017-05-04T20:52:22Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![AB77](https://avatars.discourse-cdn.com/v4/letter/a/54ee81/32.png) [@AB77](https://discuss.elastic.co/u/AB77)\
**Post date:** [May 4, 2017, 8:52pm UTC](https://discuss.elastic.co/t/creating-custom-search-result-by-mapping-query-to-a-specific-doc/84629/1 "2017-05-04T20:52:22Z")

</div>

Hi,  
So I see that you can get a JSON document based on it's id. However is it possible to also map certain queries to specific documents.

Or even search a different index based on the query. I know that it could be setup in the code that can then access the API but I am wondering if it is possible to setup some rules that would automatically trigger that in elasticsearch or if there is a plugin available to do so.

This happens to be critical for certain queries that may potentially require a workflow even though other documents happen to be a good match.

Thanks.

---

<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:** [June 1, 2017, 8:59pm UTC](https://discuss.elastic.co/t/creating-custom-search-result-by-mapping-query-to-a-specific-doc/84629/2 "2017-06-01T20:59:22Z")

</div>

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