Zend Lucene Request

I add 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 to make a request to receive only data of 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 does not work ...

+4
source share
1 answer

Well, my solution was:

$query = "type:(a) OR type:(b)";

and it’s also fine to write like this (grouping fields):

$query = "type:(a OR b)";

+5
source

All Articles