Sphinx-按日期排序,而不是按unix时间戳排序
我需要查看仅按unix时间戳的日期部分排序的结果。我的数据库中已经有一个datetime字段,我正在将其转换为unixtimestamp以便与sphinx一起使用 .conf文件中的示例代码Sphinx-按日期排序,而不是按unix时间戳排序,sphinx,Sphinx,我需要查看仅按unix时间戳的日期部分排序的结果。我的数据库中已经有一个datetime字段,我正在将其转换为unixtimestamp以便与sphinx一起使用 .conf文件中的示例代码 SELECT id, deleted, posts, createdOn, publish, UNIX_TIMESTAMP(createdOn) as date1 , thread_title, first_post \ FROM posts sql_attr_timestamp
SELECT id, deleted, posts, createdOn, publish, UNIX_TIMESTAMP(createdOn) as date1 , thread_title, first_post \
FROM posts
sql_attr_timestamp = date1
谢谢你
Imran可以使用SetSortMode功能进行排序:
$cl->SetSortMode ( SPH_SORT_ATTR_ASC, "date1" );
要按降序排序,请使用SPH\u sort\u ATTR\u DESC