diff options
author | Jon Bratseth <bratseth@oath.com> | 2021-03-26 15:59:51 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-26 15:59:51 +0100 |
commit | bddc4971f0ffc6a9ccd3d6ab57a701abc249673d (patch) | |
tree | 96c2896874fbd8af1e9c3a8af6057b72a47d12ba /container-search/src/main/java/com/yahoo/prelude/semantics/engine/ReferencedMatches.java | |
parent | cfc7927446dcea526fbdce38b8578c14671e1d6c (diff) | |
parent | 487b7df266d74511d30aa048988c9f89995d97ac (diff) |
Merge pull request #17191 from vespa-engine/bratseth/carry-weight
Bratseth/carry weight
Diffstat (limited to 'container-search/src/main/java/com/yahoo/prelude/semantics/engine/ReferencedMatches.java')
-rw-r--r-- | container-search/src/main/java/com/yahoo/prelude/semantics/engine/ReferencedMatches.java | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/container-search/src/main/java/com/yahoo/prelude/semantics/engine/ReferencedMatches.java b/container-search/src/main/java/com/yahoo/prelude/semantics/engine/ReferencedMatches.java index 274528f1fb3..f21f861a801 100644 --- a/container-search/src/main/java/com/yahoo/prelude/semantics/engine/ReferencedMatches.java +++ b/container-search/src/main/java/com/yahoo/prelude/semantics/engine/ReferencedMatches.java @@ -14,12 +14,12 @@ import com.yahoo.prelude.query.PhraseItem; */ public class ReferencedMatches { - private String contextName; + private final String contextName; - private List<Match> matches=new java.util.ArrayList<>(1); + private final List<Match> matches = new java.util.ArrayList<>(1); public ReferencedMatches(String contextName) { - this.contextName=contextName; + this.contextName = contextName; } public void addMatch(Match match) { @@ -38,12 +38,12 @@ public class ReferencedMatches { * @param label the label of the matches */ public Item toItem(String label) { - if (matches.size()==0) return null; - if (matches.size()==1) return matches.get(0).toItem(label); + if (matches.size() == 0) return null; + if (matches.size() == 1) return matches.get(0).toItem(label); - PhraseItem phrase=new PhraseItem(); // TODO: Somehow allow AND items instead here + PhraseItem phrase = new PhraseItem(); // TODO: Somehow allow AND items instead here phrase.setIndexName(label); - for (Iterator<Match> i=matches.iterator(); i.hasNext(); ) { + for (Iterator<Match> i = matches.iterator(); i.hasNext(); ) { phrase.addItem(i.next().toItem(label)); } return phrase; |