ZF-6732: Zend_Search_Lucene_Query - section 54.5.4 - incorrect search query displayed


I'm actually looking for Zend to generate a query similar to the one shown in this section (specifically the author part):

+(word1 word2 word3) author:(word4 word5) -word6

Instead, when I run this sample code, I get the following:

+(word1 word2 word3) (author:word4 author:word5) -word6

Notice that the "author" term is not on the outside of the parens as the example shows. My code is also behaving this way but I'd prefer that it work the way the example shows. I'd really like the ability to create a more streamlined query string but if that's not possible, the documentation should probably be changed.


The correct section is 46.5.4. Confirmed the typo by running the Lucene search code underneath query. Attached is a patch.

Specifying field name as a default field name for all subqueries is a query parser feature.

Field name has to be seet at term object creation time if query is constructed using API (null means "any field").

So updated doc example is more correct even queries are the same.