appbaseio / appbaseio/reactivesearch

[Vue] Apply custom query to all components

未关闭
#835 1 条评论 0 个 reaction 已指派 1 人 已被 @bietkul 认领 在 GitHub 查看
主要语言
JavaScript
星标
4.9k
派生
478
PR 合并指标
30 天内没有已合并 PR

描述

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?

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。