Skip to content

Commit

Permalink
Refactor search query to check process title across all projects of t…
Browse files Browse the repository at this point in the history
…he client
  • Loading branch information
BartChris committed Dec 10, 2024
1 parent 5d6a7d4 commit d463f2c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1782,7 +1782,8 @@ private List<PropertyDTO> filterForCorrectionSolutionMessages(List<PropertyDTO>
* @return amount as Long
*/
public Long findNumberOfProcessesWithTitle(String title) throws DataException {
return count(createSimpleQuery(ProcessTypeField.TITLE.getKey(), title, true, Operator.AND));
return countDocumentsAcrossProjects(createSimpleQuery(ProcessTypeField.TITLE.getKey(), title, true,
Operator.AND));
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,4 +106,15 @@ public List<S> findByQueryInAllProjects(QueryBuilder query, boolean related) thr
public Long countDocuments(QueryBuilder query) throws DataException {
return super.countDocuments(queryForProjects(query));
}

/**
* Execute a count query without filtering
* for projects of the current user.
* @param query
* as QueryBuilder object
* @return amount of objects according to given query or 0 if query is null
*/
public Long countDocumentsAcrossProjects(QueryBuilder query) throws DataException {
return super.countDocuments(query);
}
}

0 comments on commit d463f2c

Please sign in to comment.