Giter Site home page Giter Site logo

Comments (8)

hightman avatar hightman commented on June 21, 2024

可以吧。

Best Regards

hightman/海鳗


微信/微博:hightman
Github:https://github.com/hightman

在 2016年1月13日,下午3:46,Rafael Gu [email protected] 写道:

xunsearch是否支持同一个字段的两次range搜索?比如,有个字段是age,我能否这样搜索:10 < age < 15 and 20 < age < 25?


Reply to this email directly or view it on GitHub #28.

from xunsearch.

shoutrain avatar shoutrain commented on June 21, 2024

@hightman 问过国外的论坛,在Xapian上是可以直接支持age:15..25 OR age:35..45这种搜索语句的。但是我用XunSearch不可以,我是在增加一些索引后,在demo上测试的,如下:

util/Quest.php demo "chrono:1314336167..1314337169 OR chrono:1314341167..1314343169"

上面这条语句,OR前面或后面都可以单独查询出结果,但是一起就没有结果了。

from xunsearch.

hightman avatar hightman commented on June 21, 2024

你可以用 XSSearch:addRange 啊,放在 query 里解析似乎 不会成功。

Best Regards

hightman/海鳗


微信/微博:hightman
Github:https://github.com/hightman

在 2016年1月19日,上午10:25,Rafael Gu [email protected] 写道:

@hightman https://github.com/hightman 问过国外的论坛,在Xapian上是可以直接支持age:15..25 OR age:35..45这种搜索语句的。但是我用XunSearch不可以,我是在增加一些索引后,在demo上测试的,如下:
util/Quest.php demo "chrono:1314336167..1314337169 OR chrono:1314341167..1314343169"
上面这条语句,OR前面或后面都可以单独查询出结果,但是一起就没有结果了。


Reply to this email directly or view it on GitHub #28 (comment).

from xunsearch.

shoutrain avatar shoutrain commented on June 21, 2024

@hightman 但是addRange两次,是AND关系,或者有地方设置默认的关系?

require '/usr/local/xunsearch/sdk/php/lib/XS.php';
$xs = new XS('demo');
$search = $xs->search;

$search->setQuery('');
$search->addRange('chrono', 1314336167, 1314337169);
$search->addRange('chrono', 1314341167, 1314343169);
$docs = $search->search();

foreach($docs as $doc) {
    echo $doc->pid . ' ';
    echo $doc->subject . ' ';
    echo $doc->message . ' ';
    echo $doc->chrono . '<br/>';
}

from xunsearch.

hightman avatar hightman commented on June 21, 2024

确实不行,add range 固定为 op_filter 关系 (即AND)
parse_query 印象中是不支持2次的。

Best Regards

hightman/海鳗


微信/微博:hightman
Github:https://github.com/hightman

在 2016年1月19日,下午2:39,Rafael Gu [email protected] 写道:

@hightman https://github.com/hightman 虽然没试过,但是addRange两次,是OR关系还是AND关系呢?想到这个就觉得addRange是不是有问题?或者有地方设置默认的关系?


Reply to this email directly or view it on GitHub #28 (comment).

from xunsearch.

shoutrain avatar shoutrain commented on June 21, 2024

@hightman 好的,谢谢,那我研究一下Xapian和其PHP接口,您觉得有可能实现我想要的功能吗?如果有可能我们可以放到XunSearch中。

from xunsearch.

hightman avatar hightman commented on June 21, 2024

自己构建 Xapian::Query 肯定可以啊,只是xs这要相互通讯有点麻烦。xs每次add query都是在基础query上,而不能分离它们。

比如:当前是 q1,此时添加为 q1 and q2,再以or 添加 q3 就变成 (q1 AND q2) OR q3 而无法做到 q1 AND (q2 OR q3)

Best Regards

hightman/海鳗


微信/微博:hightman
Github:https://github.com/hightman

在 2016年1月19日,下午4:55,Rafael Gu [email protected] 写道:

@hightman https://github.com/hightman 好的,谢谢,那我研究一下Xapian和其PHP接口,您觉得有可能实现我想要的功能吗?如果有可能我们可以放到XunSearch中。


Reply to this email directly or view it on GitHub #28 (comment).

from xunsearch.

shoutrain avatar shoutrain commented on June 21, 2024

@hightman 好的,我来尝试一下,我给您的邮箱发了我的微信,希望微信能让沟通效率高一点。我现在正在CentOS 7上装Xapian.

from xunsearch.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.