branch develop updated (c4e9b3e -> 00feca5)
This is an automated email from the git hooks/post-receive script. New change to branch develop in repository coselmar. See https://gitlab.nuiton.org/codelutin/coselmar.git from c4e9b3e Merge branch 'feature/9197-Indexation_documents' into develop new 00feca5 prevent NPE The 1 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "adds" were already present in the repository and have only been added to this reference. Detailed log of new commits: commit 00feca5911709ef9b8d2133e87732606f6d485d1 Author: Yannick Martel <martel@©odelutin.com> Date: Wed May 24 13:17:44 2017 +0200 prevent NPE Summary of changes: .../indexation/QuestionsIndexationService.java | 30 ++++++++++++---------- 1 file changed, 16 insertions(+), 14 deletions(-) -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.
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 00feca5911709ef9b8d2133e87732606f6d485d1 Author: Yannick Martel <martel@©odelutin.com> Date: Wed May 24 13:17:44 2017 +0200 prevent NPE --- .../indexation/QuestionsIndexationService.java | 30 ++++++++++++---------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/coselmar-rest/src/main/java/fr/ifremer/coselmar/services/indexation/QuestionsIndexationService.java b/coselmar-rest/src/main/java/fr/ifremer/coselmar/services/indexation/QuestionsIndexationService.java index 32bb35b..fab643b 100644 --- a/coselmar-rest/src/main/java/fr/ifremer/coselmar/services/indexation/QuestionsIndexationService.java +++ b/coselmar-rest/src/main/java/fr/ifremer/coselmar/services/indexation/QuestionsIndexationService.java @@ -326,22 +326,24 @@ public class QuestionsIndexationService extends CoselmarSimpleServiceSupport { for (ScoreDoc scoreDoc : scoreDocs) { Fields termVectors = ireader.getTermVectors(scoreDoc.doc); - for (String termVector : termVectors) { - Terms vector = ireader.getTermVector(scoreDoc.doc, termVector); - TermsEnum termsEnum = vector.iterator(); - BytesRef bytesRef = termsEnum.next(); - while(bytesRef != null){ - String term = bytesRef.utf8ToString().toLowerCase(); - long totalTermFreq = termsEnum.totalTermFreq(); - - if (term.length() > TransverseIndexationService.CLOUD_TAG_WORD_MIN_SIZE) { - if (result.containsKey(term)) { - result.put(term, result.get(term) + totalTermFreq); - } else { - result.put(term, totalTermFreq); + if (termVectors != null) { + for (String termVector : termVectors) { + Terms vector = ireader.getTermVector(scoreDoc.doc, termVector); + TermsEnum termsEnum = vector.iterator(); + BytesRef bytesRef = termsEnum.next(); + while(bytesRef != null){ + String term = bytesRef.utf8ToString().toLowerCase(); + long totalTermFreq = termsEnum.totalTermFreq(); + + if (term.length() > TransverseIndexationService.CLOUD_TAG_WORD_MIN_SIZE) { + if (result.containsKey(term)) { + result.put(term, result.get(term) + totalTermFreq); + } else { + result.put(term, totalTermFreq); + } } + bytesRef = termsEnum.next(); } - bytesRef = termsEnum.next(); } } } -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.
participants (1)
-
codelutin.com scm