Project

General

Profile

Actions

Bug #19137

open

notExists, notEquals, notRegex does not work on subelements like software, disks, etc

Added by François ARMAND almost 3 years ago. Updated 18 days ago.

Status:
New
Priority:
N/A
Assignee:
-
Category:
Web - Nodes & inventories
Target version:
Severity:
UX impact:
User visibility:
Effort required:
Small
Priority:
0
Name check:
To do
Fix check:
To do
Regression:
No

Description

If a notXXX query apply on a sub element (ie a composed query with subquery), then it does not work as expected. It works for element of node summary.

Say we wan't node without sotware "soft1" installed. If we you use "software" "not regex" "soft1", we get all nodes as long as they have at least one other software than soft1.

The reason is that what we actually do is look for all software not matching soft1, then get nodes with at least one of the resulting software in their software list.
It should take node with only software in that list.
The same logic works for notEqual, but not for notExists, since we can't get the list of software that don't exists.

So we could inverse the composition, which would be more efficient too in most cases (the example on software is very telling: you likely look for nodes with one, or a couple of missing software, and so all non-matching software is likely a ten of thousand long list of elements): we could look for software mathching the regex, and only take nodes with NO software in the resulting list (that works also with notequals and notexists, if for the latter we directly translate it to "take node with no software").

This change does not seem easy at all, since we need to add logic to inverse composition of subquery (making it work correctly with and/or case).

A workaround could be to add a query field "inverse result", default to false, which would returns "all node minus the one matching the query" (and would be ok for most simple case, especially combined with the possibility to compose groupes).


Related issues 1 (0 open1 closed)

Related to Rudder - Bug #19138: Add an option to invert result of a node queryReleasedVincent MEMBRÉActions
Actions

Also available in: Atom PDF