Zend Lucene 查询
当我在 Lucene 中存储数据时,我添加了这些字段:
$index->addField(Zend_Search_Lucene_Field::Keyword('id', $entry->id));
$index->addField(Zend_Search_Lucene_Field::Keyword('type', $entry->type));
How can make a query toretrieve only data with a certain type?
我尝试过:
$query = "type IN ('a', 'b', 'c')"; // get data that has either of these types
$this->query->addSubquery(Zend_Search_Lucene_Search_QueryParser::parse($query), true);
但是没用...
I'm adding these fields when I store data in Lucene:
$index->addField(Zend_Search_Lucene_Field::Keyword('id', $entry->id));
$index->addField(Zend_Search_Lucene_Field::Keyword('type', $entry->type));
How can make a query to retrieve only data with a certain type?
I tried:
$query = "type IN ('a', 'b', 'c')"; // get data that has either of these types
$this->query->addSubquery(Zend_Search_Lucene_Search_QueryParser::parse($query), true);
but it doesn't work...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
好吧,我的解决方案是:
$query = "type:(a) OR type:(b)";
也可以这样写(字段分组):
$query =“类型:(a或b)”;
Well my solution was:
$query = "type:(a) OR type:(b)";
and it is also ok to write it like this (grouping of fields):
$query = "type:(a OR b)";