Hi Chris,
Yes, it's behavior defined by Java Lucene.
But it's planned to be changed. I work on a new query parser just now
and it will search through all indexed fields by default.
I think, that it's good idea to make it configurable.
With best regards,
Alexander Veremyev.
Chris Blaise wrote:
Of course I would have to go to the Lucene site not two minutes
after sending my message to see that it is by design.
Sorry!
Chris
-----Original Message-----
From: Chris Blaise [mailto:[EMAIL PROTECTED]
Sent: Wednesday, November 08, 2006 4:13 PM
To: [email protected]
Subject: [fw-general] Search confusion
I'm a little confused as to how this should work.
When creating fields, it seems like I should be able to
create fields like:
$doc = new Zend_Search_Lucene_Document();
$doc->addField(Zend_Search_Lucene_Field::UnIndexed('link', $file));
$doc->addField(Zend_Search_Lucene_Field::Text('from', $from));
$doc->addField(Zend_Search_Lucene_Field::Text('to', $to));
$doc->addField(Zend_Search_Lucene_Field::Text('subject', $subject));
And then queries should search against all indexed
fields, correct?
So the following query:
$hits = $index->find("important");
Should search for the "important" token in from, to,
and subject fields, correct?
What I'm seeing, even in the latest snapshot, is that
searches only work on the hardcoded 'contents' field.
Is this by design (I should concatenate the from, to,
subject fields into a single string ) or is it a bug?
Thanks,
Chris