You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@NamedQuery(name = "Rule.ReadQuery", query = "SELECT DISTINCT r.crudJPQL FROM Rule r LEFT JOIN r.grouping g LEFT JOIN g.userGroups ug LEFT JOIN ug.user u WHERE (u.name = :member OR g IS NULL) AND r.bean = :bean AND r.r = TRUE"),
@NamedQuery(name = "Rule.IncludeQuery", query = "SELECT DISTINCT r.includeJPQL FROM Rule r LEFT JOIN r.grouping g LEFT JOIN g.userGroups ug LEFT JOIN ug.user u WHERE (u.name = :member OR g IS NULL) AND r.bean = :bean AND r.r = TRUE"),
We should use this for the free text search, as we already get results in batches, and reducing the number of queries to the DB for rules should speed up the free text search component without affecting the results returned.
The text was updated successfully, but these errors were encountered:
Current behaviour
Currently, when performing a free text search using Lucene, we get results in batches of 1000, then iterate over these one by one:
icat.server/src/main/java/org/icatproject/core/manager/EntityBeanManager.java
Lines 784 to 808 in f86b255
Performing authorisation first checks for root access, public tables, and failing these, gets and evaluates rules relevant to that single entity's ID:
icat.server/src/main/java/org/icatproject/core/entity/Rule.java
Line 39 in f86b255
icat.server/src/main/java/org/icatproject/core/entity/Rule.java
Lines 165 to 166 in f86b255
Desired behaviour
There is an existing method which instead takes authorises based on several entities at once:
icat.server/src/main/java/org/icatproject/core/manager/GateKeeper.java
Lines 167 to 246 in f86b255
icat.server/src/main/java/org/icatproject/core/entity/Rule.java
Line 40 in f86b255
icat.server/src/main/java/org/icatproject/core/entity/Rule.java
Lines 167 to 168 in f86b255
We should use this for the free text search, as we already get results in batches, and reducing the number of queries to the DB for rules should speed up the free text search component without affecting the results returned.
The text was updated successfully, but these errors were encountered: