api-platform / api-platform/core
[Elasticsearch] match filters - remove constant_score and allow to sort by _score
- Lenguaje dominante
- PHP
- Estrellas
- 2.6k
- Forks
- 980
- Merge medio
- 2 d 4 h
- PR fusionados (30 d)
- 49
Descripción
Api Plaform shoud have config to disable automatically plugged ApiPlatform\Elasticsearch\Extension\ConstantScoreFilterExtension when using ApiPlatform\Elasticsearch\Filter\MatchFilter;
#[ApiFilter(MatchFilter::class, properties: ['name'])]
Actual Api Platform to ElasticSearch request returns nonsense results
```json
GET /product/_search
{
"query":{
"constant_score":{
"filter":{
"bool":{
"must":[
{
"match":{
"name":"PARKSIDE PERFORMANCE Multisvářečka s technologií dvojitého impulzu PMPS 200 A1"
}
}
]
}
}
}
},
"sort":[
{
"id":{
"order":"asc"
}
}
],
"size":30,
"from":0
}
```
Working solution
```json
GET /product/_search
{
"query":{
"bool":{
"must":[
{
"match":{
"name":"PARKSIDE PERFORMANCE Multisvářečka s technologií dvojitého impulzu PMPS 200 A1"
}
}
]
}
},
"sort":[
{
"_score":{
"order":"desc"
}
}
],
"size":30,
"from":0
}
```
Guía de contribución
Evaluación
Este issue todavía no se ha evaluado.