api-platform / api-platform/core
[Elasticsearch] match filters - remove constant_score and allow to sort by _score
- 主要語言
- PHP
- 星號
- 2.6k
- 分支
- 980
- 平均合併
- 2 天 2 小時
- 30 天內合併 PR
- 51
描述
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
}
```
貢獻指南
評估
這個 Issue 還沒有評估資料。