#130 Multi-field queries

TextIndexNG
open
Andreas Jung
5
2013-01-29
2012-06-18
Anonymous
No

Hello,

I was trying to use multi-field queries without success.

Software versions
Zope Version: (2.13.12, python 2.6.6, linux2)
Python Version: 2.6.6 (r266:84292, Dec 26 2010, 22:31:48) [GCC 4.4.5]
System Platform: linux2
Plone Version: 4.1.4 (4113)
zopyx.txng3.core-3.5.3-py2.6.egg

After debugging the code I realized that I could use multi-field queries like:
title::phrase(The Zope Book) AND author::and(michel pelletier amos lattmeier)
only if I change zopyx/txng3/core/evaluator.py as follows:

class Evaluator:
...
def _getField(self, node):
...
# Return field if exists and not self.searchrequest.field every time
if field:
return field
return self.searchrequest.field

Please, confirm this bug and solution.

Regards,
Felipe Roquette

Discussion

  • Andreas Jung
    Andreas Jung
    2012-06-19

    Can you add a unittest to your patch?

     

  • Anonymous
    2012-06-19

    Unittest? I need to learn that. I will try.