php – Zend Lucene查询

我在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);

但它不起作用……

解决方法:

我的解决方案是:

$query =“type:(a)OR type:(b)”;

也可以这样写(字段分组):

$query =“type:(a OR b)”;

相关文章

统一支付是JSAPI/NATIVE/APP各种支付场景下生成支付订单,返...
统一支付是JSAPI/NATIVE/APP各种支付场景下生成支付订单,返...
前言 之前做了微信登录,所以总结一下微信授权登录并获取用户...
FastAdmin是我第一个接触的后台管理系统框架。FastAdmin是一...
之前公司需要一个内部的通讯软件,就叫我做一个。通讯软件嘛...
统一支付是JSAPI/NATIVE/APP各种支付场景下生成支付订单,返...