appbaseio / appbaseio/reactivesearch
[Vue] Apply custom query to all components
- Ngôn ngữ chính
- JavaScript
- Star
- 4.9k
- Fork
- 478
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Mô tả
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?
Hướng dẫn đóng góp
Đánh giá
Issue này chưa được đánh giá.