appbaseio / appbaseio/reactivesearch

[Vue] Apply custom query to all components

Open
#835 1 comment 0 reactions 1 assignee Claimed by @bietkul View on GitHub
Dominant language
JavaScript
Stars
4.9k
Forks
478
PR merge metrics
No merged PRs in 30d

Description

Following up on #715 and probably #726, the solution provided for my issue (#715) solved it up to a point however I can see the queries being fired to not include the customQuery ([see sandbox](https://codesandbox.io/s/94l1mvwxqy)).

This causes a problem when the dynamic-range-slider is loaded.

The first time the page loads this query runs first:
```
{"preference":"price_range"}
{"query":
{
"match_all":{}},
"size":20,
"aggs": {"min":{"min":{"field":"minprice"}},"max":{"max":{"field":"minprice"}}
}
}
```
Notice that it doesn't include the customQuery here.

It returns:
```
{
"responses": (...),
"aggregations": {"min":{"value":15.0},"max":{"value":15500.0}},"status":200}]
}
```

Then when the ReactiveList query runs
```
{"preference":"SearchResult"}
{"query":
{"bool":{"must":[{"bool":{"must":[{"match":{"category.id":10}}]}}]}},
"size":24,
"aggs":{"min":{"min":{"field":"minprice"}},"max":{"max":{"field":"minprice"}}}
}
```
it returns
```
{
"responses":(...),
"aggregations":{"min":{"value":15.0},"max":{"value":1115.34}},"status":200}]
}
```

Notice the max values. At first the first query returned 15500 and the second one returned 1115.34.

This causes the following error on page load and my tests to fail :(
```
[VueSlider error]: The value of the slider is 15,15500, the maximum value is 1115.34, the value of this slider can not be greater than the maximum value
```

Is there any other way to make this change? Is `DataController` going to solve my issue?

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.