0

With Zned Lucene, when i search for field1:value1, I have 1000 hits returned. When I search for field2:value2, I have 0 hits returned. And when i search for field1:value1 AND field2:value2, I have 1000 hits returned, but I'd rather like to have 0 hits returned !

Why doesn't it do the intersection of the query ?

Menencia
  • 1,289
  • 1
  • 12
  • 23

1 Answers1

1

I find myself the solution. Actually it works fine this way using the zend lucene API :

$query = new Zend_Search_Lucene_Search_Query_MultiTerm();
$query->addTerm(new Zend_Search_Lucene_Index_Term(value1, field1), true);
$query->addTerm(new Zend_Search_Lucene_Index_Term(value2, field2), true);
$hits  = $index->find($query);
Menencia
  • 1,289
  • 1
  • 12
  • 23