gpt4 book ai didi

php - 搜索错误: select: memory exhausted | SPHINX Search

转载 作者:行者123 更新时间:2023-11-29 17:36:26 25 4
gpt4 key购买 nike

我正在使用 Sphinx 搜索来获取记录。我有一个查询来获取记录并根据最近的城市和评级对它们进行排序。但是,如果某个特定位置附近有许多城市,则会出现错误“searchd 错误:选择:内存耗尽”

Error : [_error] => searchd error: select: memory exhausted near '21277,49,IF(cityidv=6985,50,IF(cityidv=10801,51,IF(cityidv=21399,52,IF(cityidv=6992,53,IF(cityidv=21176,54,IF(cityidv=6891,55,IF(cityidv=11848,56,IF(cityidv=10136,57,58))))))))))))))))))))))))))))))))))))))))))))))))))))))))) AS citywisesort'`

这是我的代码:

$lat = $latitude * Pi() / 180;
$lon = $longitude * Pi() / 180;
$cl = new SphinxClient;
$cl->setSelect("* ,IF(cityidv=1981,1,IF(cityidv=13426,2,IF(cityidv=9693,3,IF(cityidv=11030,4,IF(cityidv=10370,5,IF(cityidv=14091,6,IF(cityidv=10125,7,IF(cityidv=10906,8,IF(cityidv=10825,9,IF(cityidv=10404,10,IF(cityidv=11452,11,IF(cityidv=10798,12,IF(cityidv=10106,13,IF(cityidv=13061,14,IF(cityidv=9519,15,IF(cityidv=24382,16,IF(cityidv=16087,17,IF(cityidv=25635,18,IF(cityidv=6770,19,IF(cityidv=19785,20,IF(cityidv=13051,21,IF(cityidv=10412,22,IF(cityidv=6033,23,IF(cityidv=10903,24,IF(cityidv=10810,25,IF(cityidv=10895,26,IF(cityidv=21405,27,IF(cityidv=10748,28,IF(cityidv=19305,29,IF(cityidv=10142,30,IF(cityidv=21442,31,IF(cityidv=11027,32,IF(cityidv=10138,33,IF(cityidv=18578,34,IF(cityidv=19433,35,IF(cityidv=11847,36,IF(cityidv=6597,37,IF(cityidv=10808,38,IF(cityidv=20920,39,IF(cityidv=6749,40,IF(cityidv=13059,41,IF(cityidv=10713,42,IF(cityidv=21565,43,IF(cityidv=21201,44,IF(cityidv=11012,45,IF(cityidv=9491,46,IF(cityidv=5768,47,IF(cityidv=19426,48,IF(cityidv=21277,49,IF(cityidv=6985,50,IF(cityidv=10801,51,IF(cityidv=21399,52,IF(cityidv=6992,53,IF(cityidv=21176,54,IF(cityidv=6891,55,IF(cityidv=11848,56,IF(cityidv=10136,57,58))))))))))))))))))))))))))))))))))))))))))))))))))))))))) AS citywisesort");
$cl->SetSortMode(SPH_SORT_EXTENDED, "citywisesort ASC,rating DESC);
$cl->SetMatchMode(SPH_MATCH_EXTENDED);
$result = $cl->Query("", "record");

有什么办法可以增加内存大小吗?所以它不会耗尽

谢谢。

最佳答案

有一种方法,但它需要破解源代码并从源代码重建。在您的情况下,您最好使用 SphinxQL 和 REMAP() 而不是 IF() 。

关于php - 搜索错误: select: memory exhausted | SPHINX Search,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50250537/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com