This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository coselmar. See https://gitlab.nuiton.org/codelutin/coselmar.git commit 8c1ceef8c5b2f7f22b6fc68a03f9ef1eefa78249 Author: Yannick Martel <martel@©odelutin.com> Date: Tue Jun 13 20:16:02 2017 +0200 fixes #9197 fix pg request for question cloud words to be able to manage no documents and documents with no fileContent --- .../coselmar/persistence/entity/QuestionTopiaDao.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/coselmar-persistence/src/main/java/fr/ifremer/coselmar/persistence/entity/QuestionTopiaDao.java b/coselmar-persistence/src/main/java/fr/ifremer/coselmar/persistence/entity/QuestionTopiaDao.java index 54ef0ae..4b6d4ac 100644 --- a/coselmar-persistence/src/main/java/fr/ifremer/coselmar/persistence/entity/QuestionTopiaDao.java +++ b/coselmar-persistence/src/main/java/fr/ifremer/coselmar/persistence/entity/QuestionTopiaDao.java @@ -374,7 +374,7 @@ public class QuestionTopiaDao extends AbstractQuestionTopiaDao<Question> { private final String getSql(String questionId) { return "SELECT word, nentry FROM ts_stat( ' " + - " with documents as ( select d." + Document.PROPERTY_NAME + " as name, d." + Document.PROPERTY_SUMMARY + " as summary, d." + Document.PROPERTY_FILE_CONTENT + " as fileContent, (SELECT string_agg(dk." + Document.PROPERTY_KEYWORDS + ", '' '') from document_keywords dk where dk.owner = d.topiaid) as keywords " + + " with documents as ( select d." + Document.PROPERTY_NAME + " as name, d." + Document.PROPERTY_SUMMARY + " as summary, d." + Document.PROPERTY_FILE_CONTENT + " as fileContent, (SELECT COALESCE(string_agg(dk." + Document.PROPERTY_KEYWORDS + ", '' ''),'''') from document_keywords dk where dk.owner = d.topiaid) as keywords " + " from question k " + " LEFT JOIN relateddocuments_relatedquestion RD ON RD.relatedquestion = k.topiaid " + " LEFT JOIN closingdocuments_relatedquestion CD ON CD.relatedquestion = k.topiaid " + @@ -382,11 +382,11 @@ public class QuestionTopiaDao extends AbstractQuestionTopiaDao<Question> { " WHERE k.topiaid = ''" + questionId + "'' ) " + " SELECT to_tsvector(''public.simple_english_conf'', q." + Question.PROPERTY_TITLE + ") " + " || to_tsvector(''public.simple_english_conf'', q." + Question.PROPERTY_SUMMARY + ") " + - " || to_tsvector(''public.simple_english_conf'', (SELECT string_agg(qt." + Question.PROPERTY_THEME + ", '' '') from question_theme qt where qt.owner = q.topiaid ) ) " + - " || to_tsvector(''public.simple_english_conf'', (SELECT string_agg(name, '' '') FROM documents) ) " + - " || to_tsvector(''public.simple_english_conf'', (SELECT string_agg(summary, '' '') FROM documents) ) " + - " || to_tsvector(''public.simple_english_conf'', (SELECT string_agg(keywords, '' '') FROM documents) ) " + - " || to_tsvector(''public.simple_english_conf'', (SELECT string_agg(fileContent, '' '') FROM documents)) " + + " || to_tsvector(''public.simple_english_conf'', (SELECT COALESCE(string_agg(qt." + Question.PROPERTY_THEME + ", '' ''),'''') from question_theme qt where qt.owner = q.topiaid ) ) " + + " || to_tsvector(''public.simple_english_conf'', (SELECT COALESCE(string_agg(name, '' ''),'''' ) FROM documents) ) " + + " || to_tsvector(''public.simple_english_conf'', (SELECT COALESCE(string_agg(summary, '' ''),'''' ) FROM documents) ) " + + " || to_tsvector(''public.simple_english_conf'', (SELECT COALESCE(string_agg(keywords, '' ''),'''' ) FROM documents) ) " + + " || to_tsvector(''public.simple_english_conf'', (SELECT COALESCE(string_agg(fileContent, '' ''),'''' ) FROM documents)) " + " FROM question q where q.topiaid = ''" + questionId + "'' ') " + " WHERE char_length(word) > " + CloudWordUtils.CLOUD_TAG_WORD_MIN_SIZE + " AND word NOT IN ( " + Joiner.on(',').join(Lists.transform(CloudWordUtils.MANUAL_EXCLUDED_TERMS_IN_CLOUD, CloudWordUtils.SQLIFY_STRING)) + " ) " + -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.