appbaseio / appbaseio/reactivesearch

Strict query execution policy

Open
#182 0 comments 0 reactions 0 assignees View on GitHub
enhancement idea :thinking:
Dominant language
JavaScript
Stars
4.9k
Forks
478
PR merge metrics
No merged PRs in 30d

Description

**Issue Type:**
Enhancement

**Description:**
Currently, we allow execution of null queries when query-options (`sort`, `from`, `size`) are present. This can result in an extra query request - Check DataSearch component, it happens after clearing the current-value and this can happen in other components as well.

Consider this use-case:

When a component's query is cleared `query: null` and it has some query options present like `size: 20` (as in case of DataSearch), an unnecessary empty query `{ size: 20 }` gets executed since we loosely execute queries at reactivecore.

Ideally, we should should strictly check for keys like - `query`, `sort`* or `aggs`, if present, then execute the query, otherwise only update the query-tree and do not execute the query. This will have some side-effects in the actuator components when no `defaultQuery` is present, which we can handle by adding a default `match_all: {}` query.

(Need to look more into this, as it may have some unexpected side-effects in other components as well)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.