我最近一直在使用elastisearch trough elastica,但我在使用正则表达式时遇到了问题。
这是我的问题:
我需要找到“名称”不以字母开头的“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"
基本上我找不到我应该从 Elastica 使用什么类型的查询类。
谢谢你的帮助 !