Eric Hz
Eric Hz

Reputation: 55

maxScore returned as NaN

Using Solarium 5.1.0 I'm creating the following query :

select?omitHeader=true&wt=json&json.nl=flat&q=%2A%3A%2A&start=0&rows=10&fl=%2A%2Cscore&group=true&group.query=category_id%3A149&group.query=category_id%3A151

Query works and returns

{"grouped":{"category_id:149":{"matches":216,"doclist":{"numFound":44,"start":0,"maxScore":1.0,"docs":[docs_i_removed]}},"category_id:151":{"matches":216,"doclist":{"numFound":0,"start":0,"maxScore":"NaN","docs":[]}}}}

But Solarium throws an error because it is expecting either null or float for the "maxScore" value when calling ->getFacetSet().

"Argument 4 passed to Solarium\\Component\\Result\\Grouping\\QueryGroup::__construct() must be of the type float or null, string given, called in \/solarium\/solarium\/src\/Component\/ResponseParser\/Grouping.php on line 96"

I haven't found anyone with similar issue over the net, does anyone have any clue how to solve this issue?

Edited

PHP code is following:

$client = new \Solarium\Client($solr_config);
$query = $client->createSelect();
$group_component = $query->getGrouping();
$grouping_queries = [
    "category_id:149",
    "category_id:151",
];
$group_component->addQueries($grouping_queries);
$resultset = $client->select($query);
$facet_set = $resultset->getFacetSet();

Upvotes: 0

Views: 103

Answers (0)

Related Questions