I'm trying to build a query using the following code:
q = Q(Q('class','comment') | Q('class','post')) & Q('text','things')
I was expecting the output to be:
(class:(post) OR class:(comment)) text:'things'
instead I get:
(class:(comment) class:(post) AND text:(things))
Which is obviously wrong and doesn't work.
For reference a query of:
Q( Q('a')|Q('b')) & Q('text','things')
does actually output the correct query:
((a OR b) AND text:(things))
I'm trying to build a query using the following code:
q = Q(Q('class','comment') | Q('class','post')) & Q('text','things')I was expecting the output to be:
(class:(post) OR class:(comment)) text:'things'instead I get:
(class:(comment) class:(post) AND text:(things))Which is obviously wrong and doesn't work.
For reference a query of:
Q( Q('a')|Q('b')) & Q('text','things')does actually output the correct query:
((a OR b) AND text:(things))