我最近一直在使用弹性搜索低谷埃拉斯提卡,而且我在使用regexp时遇到了问题。
我的问题是:
我需要找到--我的"Foo“实体的所有实例都带有”名称“,而不是以字母开头。
class Foo
{
protected $name; // example: "1&1", "OVH", "Aliyun" ...
}根据elasticsearch文档,有一个"regexp“过滤器,但是我找不到elastica中的实现。
我试过:
\Elastica\Query\Prefix(); //Apparently it doesn't handle the regexp从我能得到的文件中:
$reg = '@&~(foo.+)'; # anything except string beginning with "foo"基本上,我无法从.中找到应该使用哪种类型的查询类。
谢谢你的帮助!
发布于 2013-11-19 22:48:38
我不知道Elastica,但是一个快速搜索告诉我实现Regexp的唯一类
以及它在测试用例中的使用示例:
Elastica\test\lib\Elastica\Test\Filter\RegexpTest
希望这能有所帮助!
https://stackoverflow.com/questions/20028776
复制相似问题