The sphsf-range query is invalid.

Source: Internet
Author: User
The coreseek3.2 version used now has a mysql source, including fields such as id, addtime, uid, and title. Here, addtime is a unix timestamp, and now you want to perform a range query based on addtime. The Code is as follows: {code ...} however, there is no such use. $ result is false. When addti... is removed... the coreseek3.2 version used now has a mysql source, including fields such as id, addtime, uid, and title. Here, addtime is a unix timestamp, and now you want to perform a range query based on addtime. The Code is as follows:

$s = new SphinxClient;$s->setServer("localhost", 9312);$s->setArrayResult(true);$s->setMatchMode(SPH_MATCH_EXTENDED2);$s->SetFilterRange('addtime',0,99999999999);$result = $s->query('word', 'request_log_order');print_r($result);

However, there is no such thing,$resultIsfalseAfter the addtime filter is removed, the results can be properly filtered. The value of addtime is indeed between 0 and 9999999999.

Question 2: Do not set keywords, that is, I only need to limit the addtime range, and do not need to set search keywords. The query method must contain a keyword?

The application scenario is as follows. You need to filter data with more than N orders in a specified date. Due to the complexity of SQL statements and slow execution speed, coreseek is used.

Reply content:

The coreseek3.2 version used now has a mysql source, including fields such as id, addtime, uid, and title. Here, addtime is a unix timestamp, and now you want to perform a range query based on addtime. The Code is as follows:

$s = new SphinxClient;$s->setServer("localhost", 9312);$s->setArrayResult(true);$s->setMatchMode(SPH_MATCH_EXTENDED2);$s->SetFilterRange('addtime',0,99999999999);$result = $s->query('word', 'request_log_order');print_r($result);

However, there is no such thing,$resultIsfalseAfter the addtime filter is removed, the results can be properly filtered. The value of addtime is indeed between 0 and 9999999999.

Question 2: Do not set keywords, that is, I only need to limit the addtime range, and do not need to set search keywords. The query method must contain a keyword?

The application scenario is as follows. You need to filter data with more than N orders in a specified date. Due to the complexity of SQL statements and slow execution speed, coreseek is used.

Is it 64-bit? So many 9 exceeds the 32-bit range.

1. Data with more than N orders in a specified date
The database will be able to handle it. Add an index. It should be OK.

2. the query method must contain a keyword.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.