# Connect to a meta engine or to each engine separately, to get results from each engine

**URL:** https://discuss.elastic.co/t/connect-to-a-meta-engine-or-to-each-engine-separately-to-get-results-from-each-engine/244554
**Category:** Elastic Search
**Tags:** elastic-app-search
**Created:** [August 11, 2020, 1:01pm UTC](https://discuss.elastic.co/t/connect-to-a-meta-engine-or-to-each-engine-separately-to-get-results-from-each-engine/244554 "2020-08-11T13:01:43Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![sttevan88](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sttevan88/32/74096_2.png) [@sttevan88](https://discuss.elastic.co/u/sttevan88)
#### Post date: [August 11, 2020, 1:01pm UTC](https://discuss.elastic.co/t/connect-to-a-meta-engine-or-to-each-engine-separately-to-get-results-from-each-engine/244554/1 "2020-08-11T13:01:43Z")

</div>

Hi elastic community,

We just started using app search in our web app, but are running into some problems.

USE CASE:  
on our landing page we have 2 sections. (will be 5 soon) each section shows N posts, first section is for reviews and the other is for other posts.

we have an engine in app search for reviews and another one for other posts, also we have a meta engine that combines the two (will combine 5)

What we need is to:

either, meta engine can be limited per engine (thats part of it ) so that we can guarantee to get N amount of reviews and M amount of posts

or, connect to multiple engines, but all of them use the same elastic-ui search provider.

any idea if the first one is possible and how, if not, any idea how to implement the latter.

Cheers

---

<div class="post-metadata">

### Author: ![JasonStoltz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jasonstoltz/32/49893_2.png) [@JasonStoltz](https://discuss.elastic.co/u/JasonStoltz)
#### Post date: [August 13, 2020, 12:49pm UTC](https://discuss.elastic.co/t/connect-to-a-meta-engine-or-to-each-engine-separately-to-get-results-from-each-engine/244554/2 "2020-08-13T12:49:51Z")

</div>

Re-phrasing this for my own understanding:

You have 2 types of documents, posts and reviews. You store them in 2 separate engines. You also have a meta-engine to combine the 2.

You are using [search-ui](https://github.com/elastic/search-ui).

In your search experience, you need to make it so that you see 5 results of each type, in a single experience, using a single SearchProvider.

Option A:  
Adapt your search experience to something like we have on [elastic.co](http://elastic.co): [https://www.elastic.co/search?q=app%20search&size=n\_20\_n](https://www.elastic.co/search?q=app%20search&size=n_20_n). We have different result types, they are just hidden behind tabs.

Option B:  
To get the experience you're looking for, you will have to do 2 separate API calls.

Instead of using our App Search Connector, [implement your own handler](https://github.com/elastic/search-ui/blob/master/ADVANCED.md#connectors-and-handlers) that makes 2 separate App Search API calls and condenses the two result sets into a single result set. This will definitely be challenging.

---

<div class="post-metadata">

### Author: ![JasonStoltz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jasonstoltz/32/49893_2.png) [@JasonStoltz](https://discuss.elastic.co/u/JasonStoltz)
#### Post date: [August 18, 2020, 11:38am UTC](https://discuss.elastic.co/t/connect-to-a-meta-engine-or-to-each-engine-separately-to-get-results-from-each-engine/244554/3 "2020-08-18T11:38:06Z")

</div>

@sttevan88,

Actually, just thought of this, you might be able to solve this by using grouping: [https://www.elastic.co/guide/en/app-search/7.8/grouping.html](https://www.elastic.co/guide/en/app-search/7.8/grouping.html). That would let you have 2 sections with 5 posts each, combined into the same set of results.

Jason

---

<div class="post-metadata">

### Author: ![sttevan88](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sttevan88/32/74096_2.png) [@sttevan88](https://discuss.elastic.co/u/sttevan88)
#### Post date: [August 18, 2020, 2:13pm UTC](https://discuss.elastic.co/t/connect-to-a-meta-engine-or-to-each-engine-separately-to-get-results-from-each-engine/244554/4 "2020-08-18T14:13:38Z")

</div>

Thanks @JasonStoltz I will definitely try this approach! But looking at the API ref, it looks promising for my use-case.

---

<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: [September 15, 2020, 2:13pm UTC](https://discuss.elastic.co/t/connect-to-a-meta-engine-or-to-each-engine-separately-to-get-results-from-each-engine/244554/5 "2020-09-15T14:13:52Z")

</div>

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