# Using AppSearch relevance tuning with Elasticsearch search API for App Search

**URL:** https://discuss.elastic.co/t/using-appsearch-relevance-tuning-with-elasticsearch-search-api-for-app-search/360377
**Category:** Elastic Search
**Created:** [May 28, 2024, 12:39pm UTC](https://discuss.elastic.co/t/using-appsearch-relevance-tuning-with-elasticsearch-search-api-for-app-search/360377 "2024-05-28T12:39:57Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![vva](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vva/32/134868_2.png) [@vva](https://discuss.elastic.co/u/vva)
#### Post date: [May 28, 2024, 12:39pm UTC](https://discuss.elastic.co/t/using-appsearch-relevance-tuning-with-elasticsearch-search-api-for-app-search/360377/1 "2024-05-28T12:39:57Z")

</div>

Hi,  
I have created a App Search engine, which is based on existing Elasticsearch index.  
Can I use Elasticsearch search API for App Search ([Elasticsearch search API for App Search | App Search documentation [8.13] | Elastic](https://www.elastic.co/guide/en/app-search/current/elasticsearch-search-api-reference.html)) with my custom Relevance tuning/Synonyms/etc configured in the engine? It looks like this configuration works only for Search API and is ignored in `GET <enterprise-search-base-url>/api/as/v1/engines/<engine>/elasticsearch/_search` method.

I would like to know if it is somehow possible to use regular elasticsearch query syntax together with App Search engine configuration?

Also can I somehow retrieve original document source when using Search API `GET <ENTERPRISE_SEARCH_BASE_URL>/api/as/v1/engines/<engine_name>/search`?

---

<div class="post-metadata">

### Author: ![Kathleen\_DeRusso](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kathleen_derusso/32/132039_2.png) [@Kathleen\_DeRusso](https://discuss.elastic.co/u/Kathleen_DeRusso)
#### Post date: [May 28, 2024, 3:50pm UTC](https://discuss.elastic.co/t/using-appsearch-relevance-tuning-with-elasticsearch-search-api-for-app-search/360377/2 "2024-05-28T15:50:40Z")

</div>

Hi @vva thanks for the question.

There's not really a good way to do this, but there is one potential workaround.

First, you can use the [explain API](https://www.elastic.co/guide/en/app-search/current/search-explain.html) to get the current raw Elasticsearch query that App search creates. This can be a good starting point to use configuration like relevance tuning etc. You can then send in Elasticsearch queries, either directly in Elasticsearch or via the [Elasticsearch search API](https://www.elastic.co/guide/en/app-search/current/elasticsearch-search-api-reference.html).

[Curations](https://www.elastic.co/guide/en/app-search/current/curations-guide.html) and [Synonyms](https://www.elastic.co/guide/en/app-search/current/synonyms-guide.html) will not work out of the box, but you can set up Elasticsearch [synonyms](https://www.elastic.co/guide/en/elasticsearch/reference/current/synonyms-apis.html) and [query rules](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-using-query-rules.html) if needed.

---

<div class="post-metadata">

### Author: ![vva](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vva/32/134868_2.png) [@vva](https://discuss.elastic.co/u/vva)
#### Post date: [June 3, 2024, 7:13am UTC](https://discuss.elastic.co/t/using-appsearch-relevance-tuning-with-elasticsearch-search-api-for-app-search/360377/3 "2024-06-03T07:13:03Z")

</div>

Thank you for the reply. Looks like this workaround will be the solution. It has some performance overhead and code complexity drawbacks, but in general I tested it and it works.

---

<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 1, 2024, 7:13am UTC](https://discuss.elastic.co/t/using-appsearch-relevance-tuning-with-elasticsearch-search-api-for-app-search/360377/4 "2024-07-01T07:13:15Z")

</div>

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