Sphinx Range Query does not take effect

Source: Internet
Author: User
Using the coreseek3.2 version, there is now a MySQL source, including fields such as Id,addtime,uid,title. Where Addtime is the Unix timestamp, now want to do scope query according to 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);

But there is no egg, $result for false , when removed addtime filter can be filtered to the results, the value of Addtime is indeed located between 0-9999999999.

Question two: How to not set the keyword, that is, I only need to limit the scope of addtime, do not need to set search keywords. The query method must pass a keyword?

The scenario is this, you need to filter out the number of orders in the specified date more than n pen data, because the SQL statement complex, slow execution, so consider using Coreseek implementation.

Reply content:

Using the coreseek3.2 version, there is now a MySQL source, including fields such as Id,addtime,uid,title. Where Addtime is the Unix timestamp, now want to do scope query according to 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);

But there is no egg, $result for false , when removed addtime filter can be filtered to the results, the value of Addtime is indeed located between 0-9999999999.

Question two: How to not set the keyword, that is, I only need to limit the scope of addtime, do not need to set search keywords. The query method must pass a keyword?

The scenario is this, you need to filter out the number of orders in the specified date more than n pen data, because the SQL statement complex, slow execution, so consider using Coreseek implementation.

Is it a 64-bit? So many 9 more than 32 bits in range.

1, the number of orders in the specified date more than n pen data
The database can be processed, add an index, it should be OK

2, the query method must pass a key word

  • Related Article

    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.