【发布时间】:2011-09-05 15:42:35
【问题描述】:
我在 Lucene 中存储数据时添加了这些字段:
$index->addField(Zend_Search_Lucene_Field::Keyword('id', $entry->id));
$index->addField(Zend_Search_Lucene_Field::Keyword('type', $entry->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);
但它不起作用......
【问题讨论】:
-
好的,我找到了使用
type:(a) OR type:(b)等的解决方案。 -
您是否考虑将您的评论作为实际答案?这是OK to self-answer您自己的问题。这将有助于保持“未回答”列表中的问题仍然没有回答^^
标签: php lucene zend-search-lucene