Description of problem: When I query a system's activity log, I can only use one field in the Lucene expression - whenever I use AND/OR (or a query with space, %20, anywhere), I get an empty result. $ curl -sf 'https://<hub>/systems/<fqdn>/activity/?q=action:on%20AND%20field_name:Power' { "count": 0, "entries": [], "page": 1, "page_size": 20, "q": "action:on AND field_name:Power" } Both of these fields work when used individually. Version-Release number of selected component (if applicable): 23.3 How reproducible: always Steps to Reproduce: 1. curl -sf 'https://<hub>/systems/<fqdn>/activity/?q=action:on%20AND%20field_name:Power' Actual results: Beaker returns empty result set Expected results: Beaker returns entries matching the expression Additional info: http://lucene.apache.org/core/2_9_4/queryparsersyntax.html#Boolean%20operators
The Beaker JSON endpoints don't understand AND or OR operators currently. But actually the default is already AND when you specify multiple terms (there is no way specify OR currently). So the search you want to do here is just: action:on field_name:Power It seems that this default is contradictory to the Lucene query parser defaults, and is also not mentioned in our Beaker docs. (I think it matches the Solr default behaviour though.) So we should document that better at least.
Oh, I tried that (as the Lucene page mentions it as the alternative syntax to AND), but it somehow didn't work. Trying it again, it seems to work indeed. Thanks.
(In reply to Jiri Jaburek from comment #2) If you put the actual word "AND" into your search it would probably return no results because it is trying to search for the string "AND" (contrary to how the real Lucene query parser works) which most likely doesn't appear in any rows. So maybe that is why.
(In reply to Dan Callaghan from comment #3) > (In reply to Jiri Jaburek from comment #2) > > If you put the actual word "AND" into your search it would probably return > no results because it is trying to search for the string "AND" (contrary to > how the real Lucene query parser works) which most likely doesn't appear in > any rows. So maybe that is why. No, I simply used space-separated keywords which is the "alternative syntax" I mentioned - from the apache.org page: The OR operator is the default conjunction operator. This means that if there is no Boolean operator between two terms, the OR operator is used. To search for documents that contain either "jakarta apache" or just "jakarta" use the query: "jakarta apache" jakarta or "jakarta apache" OR jakarta However I misremembered it as AND instead of OR, which would explain my confusion. Beaker indeed treats space-separation as AND, as you explained above.
As a short term fix I've filed Bug 1411560 to document what is currently different. Long term, this bug is about fixing the differences and provide the full Lucene query parser syntax.