I am trying to create an "advanced search", where I can let the user search only specific fields of my index. For that, I'm using a boolean query:
$sq1 = Zend_Search_Lucene_Search_QueryParser::parse($field1); // <- provided by user
$sq2 = Zend_Search_Lucene_Search_QueryParser::parse($field2); // <- provided by user
$query = new Zend_Search_Lucene_Search_Query_Boolean();
$query->addSubquery($sq1, true);
$query->addSubquery($sq2, true);
$index->find($query);
How can I specify specify that sq1 will search field 'foo', and sq2 will search field 'bar'?
I feel like I should be parsing the queries differently for the effect (because the user might type in a field name), but the docs only mention the QueryParser for joining user-input queries with API queries.