appbaseio / appbaseio/reactivesearch

[Vue] Apply custom query to all components

Abierto
#835 1 comentario 0 reacciones 1 asignado Reclamado por @bietkul Ver en GitHub
Lenguaje dominante
JavaScript
Estrellas
4.9k
Forks
478
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

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?

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.