Filters "composite of composite" buggy?
Posted: Thu Nov 06, 2008 12:35 pm
Hi,
"Composite of composites" does not seem to work right. (using v2.2.3 right now - haven't tested in earlier versions)
Example:
author1 - author - contains "foo"
author2 - author - contains "bar"
authors - composite - author1|author2
subject1 - subject - contains "xyz"
subject2 - subject - contains "zyx"
subjects - composite - subject1|subject2
kill - composite - authors|subjects
I have made the "kill" filter also as a view filter so I can see the results, and indeed it will only take the rule which is first before the boolean or and ignores the other.
I.e. I get different results depending on if I define authors first and different when I define subjects first - the second part is always ignored.
Of course, I have tested that these filters work individually, and they work if I define them all in a single composite (and that is a workaround for now, but becomes quickly difficult to manage for me - I like structure and this would make it easier to manage) but composite of composites breaks.
Edit: I think I understand what happens here, but of course I can't be certain without having the code myself. There indeed seems to be a bug for nested composites whereas they always will behave as boolean AND operators effectively.
What probably happens is it looks at the first term and then applies the latter term what is left after that, whereas with an OR operator it should really look at the items which were already filtered out with the first term.
I once wrote a similar bug myself.
"Composite of composites" does not seem to work right. (using v2.2.3 right now - haven't tested in earlier versions)
Example:
author1 - author - contains "foo"
author2 - author - contains "bar"
authors - composite - author1|author2
subject1 - subject - contains "xyz"
subject2 - subject - contains "zyx"
subjects - composite - subject1|subject2
kill - composite - authors|subjects
I have made the "kill" filter also as a view filter so I can see the results, and indeed it will only take the rule which is first before the boolean or and ignores the other.
I.e. I get different results depending on if I define authors first and different when I define subjects first - the second part is always ignored.
Of course, I have tested that these filters work individually, and they work if I define them all in a single composite (and that is a workaround for now, but becomes quickly difficult to manage for me - I like structure and this would make it easier to manage) but composite of composites breaks.
Edit: I think I understand what happens here, but of course I can't be certain without having the code myself. There indeed seems to be a bug for nested composites whereas they always will behave as boolean AND operators effectively.
What probably happens is it looks at the first term and then applies the latter term what is left after that, whereas with an OR operator it should really look at the items which were already filtered out with the first term.
I once wrote a similar bug myself.