There is currently no way to explicitly not search for a field in the Lucene query language or the Zend_Search_Lucene query designer API.
However, you can explicitly specify which fields you want to search in the query. An example is:
seller-name: Joe McBob
If you use this approach, you will need to explicitly indicate which fields you want to request and what to look for in them. Therefore, if you also need to search for the same text in the item-title field, you will have to duplicate the above, but with a different field name. An example is:
seller-name: Joe McBob OR item-title: JoeMcBob
You can, of course, do all this through the query building API that Zend_Search_Lucene provides. manual has some good examples.
It is worth noting here that, as you have discovered, Zend_Search_Lucene will search ALL fields by default. This is one of the ways it differs from Java Lucene. However, you can set the default field for the query using the static setDefaultSearchField method of the setDefaultSearchField class.
source share