【发布时间】:2018-11-08 03:11:54
【问题描述】:
如果您通过 cURL 进行 get 请求,Elasticsearch 会提供一个分数字段。
{
"_index": "twitter",
"_type": "tweet",
"_id": "123",
"_score": 4.2,
"firstName": "Max"
"lastName": "Mustermann"
}
有没有办法在 symfony 中获得这个分数。我想知道 FOSElasticaBundle 是否提供类似于下面的函数来获取分数。
$finder = $this->container->get('fos_elastica.finder.app.article');
$boolQuery = new \Elastica\Query\BoolQuery();
$fieldQuery = new \Elastica\Query\Match();
$fieldQuery->setFieldQuery('title', 'I am a title string');
$fieldQuery->setFieldParam('title', 'analyzer', 'my_analyzer');
$boolQuery->addShould($fieldQuery);
【问题讨论】:
标签: php symfony elasticsearch elastica foselasticabundle