Remove unnecessary whereNotNull guard from facets subquery
The whereNotNull('final_entities.final_entity') was copied from other
code paths that select the final_entity column, but the facets subquery
only needs entity_id. Removing it preserves exact v1.49 semantics
(search rows only exist for stitched entities anyway, due to the FK
cascade from search -> final_entities) and avoids an inconsistency
where the no-filter path did not exclude unstitched entities while the
with-filter path did.
Signed-off-by: Fredrik Adelöw <freben@spotify.com>
Made-with: Cursor
This commit is contained in:
@@ -695,9 +695,9 @@ export class DefaultEntitiesCatalog implements EntitiesCatalog {
|
||||
// against one-row-per-entity rather than the much larger search
|
||||
// table. This keeps the facets aggregation fast even with many
|
||||
// filter clauses or permission conditions.
|
||||
const entityIdSubquery = this.database('final_entities')
|
||||
.select('final_entities.entity_id')
|
||||
.whereNotNull('final_entities.final_entity');
|
||||
const entityIdSubquery = this.database('final_entities').select(
|
||||
'final_entities.entity_id',
|
||||
);
|
||||
|
||||
applyEntityFilterToQuery({
|
||||
filter: request.filter,
|
||||
|
||||
Reference in New Issue
Block a user