Elasticsearch: Run getTerms trough resource call if enableElasticsearchBackendQuerying enabled (#67848)

* Elasticsearch: Run getTerms torugh backend if toggle enabled

* Add template variables to devenv dashboard for easier testing

* Add TODO

* Run feature toggle gen to fix build
This commit is contained in:
Ivana Huckova
2023-05-06 10:00:43 +02:00
committed by GitHub
parent b2e1b3ad91
commit 3145660f5a
4 changed files with 591 additions and 8 deletions

View File

@@ -183,8 +183,9 @@ func (s *Service) CallResource(ctx context.Context, req *backend.CallResourceReq
logger := eslog.FromContext(ctx)
// allowed paths for resource calls:
// - empty string for fetching db version
// - /?/_mapping for fetching index mapping
if req.Path != "" && !strings.HasSuffix(req.Path, "/_mapping") {
// - ?/_mapping for fetching index mapping
// - _msearch for executing getTerms queries
if req.Path != "" && !strings.HasSuffix(req.Path, "/_mapping") && req.Path != "_msearch" {
return fmt.Errorf("invalid resource URL: %s", req.Path)
}