Hello,
My question is related with Lucene search. I'm trying to search all of
the document fields for a given needle (which is user defined) and I
want at the same time to search only part of the documents, which
belongs to one of the clients. Bellow is my code, which I use to search
$this->search->find('"sample needle" AND company_id:99999999999');
So I want to search all of the fields for "sample needle" and limit the
results only to documents which belongs to client with id = 99999999999.
Here is the code which I used to create the index:
$doc = new Zend_Search_Lucene_Document();
$doc->addField(Zend_Search_Lucene_Field::Keyword('id', $id, 'utf-8'));
$doc->addField(Zend_Search_Lucene_Field::Keyword('company_id',
$form->getValue('company_id'), 'utf-8'));
$doc->addField(Zend_Search_Lucene_Field::Text('contact',
$form->getValue('contact'), 'utf-8'));
$doc->addField(Zend_Search_Lucene_Field::Keyword('phone',
$form->getValue('phone'), 'utf-8'));
$this->search->addDocument($doc);
I can't understand why I aways get the documents where the contact field
is set to "sample needle", does not matter what's the value of
company_id ? Do you have any suggestions ?
Thanks in advance,
S.G.