Aggregate Raw query
FT.AGGREGATE indexName "@geofield:[-83.81373 34.3755452645611 20 mi]" LOAD 1 @geofield APPLY "@cc_sum * ( 20 - (geodistance(@geofield, -83.81373, 34.3755452645611)) / 20)" as ccSumCalcValue APPLY 1 as test GROUPBY 1 @test REDUCE SUM 1 @ccSumCalcValue as weightedSum
Aggregate query using the "MacFJA/php-redisearch"
$query = '@geofield:[-83.81373 34.3755452645611 20 mi]';
$resultAggregate = $aggregate
->withIndexName('indexName ')
->withLoad(['geofield', 'cc_sum', 'if_fat'])
->withQuery($query)
->withApplies(['@cc_sum * ( 20 - (geodistance(@geofield, -83.81373, 34.3755452645611)) / 20)' => 'ccSumCalcValue'])
->addGroupBy(['ccSumCalcValue'], [])
->execute();
I am not able to do the following command from raw aggregate query using this library
APPLY 1 as test GROUPBY 1 @test REDUCE SUM 1 @ccSumCalcValue as weightedSum
Can someone help me out to do this command using this library