Comment 1 for bug 1541115

Revision history for this message
Steve McLellan (sjmc7) wrote :

Looking a bit more at this, i think the query creation code is unnecessarily complicated. There's no reason to run a filtered query against each resource type; the filtering should look like (pseudo code):

  FILTER:
      SHOULD:
          INDEX:searchlight TYPE:OS::Nova::Server TERM:tenant_id=abc
          INDEX:searchlight TYPE:OS::Nova::Server TERM:tenant_id=abc
  QUERY: <whatever query is>

The 'common' filters that are getting added (deletion flag, role based) can either be added as a top level MUST to the FILTER part (meaning, 'all of these common things plus one of the SHOULDs plus the query') or inside each SHOULD piece. The former is probably slightly more performant; the latter makes more sense given that facet querying has to use the same information and is self contained in plugins.