Github user xristy commented on a diff in the pull request:

    https://github.com/apache/jena/pull/436#discussion_r195736987
  
    --- Diff: 
jena-text/src/main/java/org/apache/jena/query/text/TextIndexLucene.java ---
    @@ -316,6 +326,13 @@ protected Document doc(Entity entity) {
                         if (this.isMultilingual) {
                             // add a field that uses a language-specific 
analyzer via MultilingualAnalyzer
                             doc.add(new Field(e.getKey() + "_" + lang, 
(String) e.getValue(), ftText));
    +                        // add fields for any defined auxiliary indexes
    +                        List<String> auxIndexes = Util.getAuxIndexes(lang);
    +                        if (auxIndexes != null) {
    --- End diff --
    
    ``auxIndexes.get(tag)`` will return null if ``tag`` has no auxiliary 
indexes defined - which is not an unusual case. 
    
    As I look at ``Util.getAuxIndexes`` I unnecessarily return an empty list 
that then does no work in the guarded ``for`` loop. I'm changing to ``null`` in 
the case of a ``null`` or empty ``tag``.


---

Reply via email to