diff options
author | Jon Bratseth <bratseth@verizonmedia.com> | 2019-06-28 06:13:15 -0500 |
---|---|---|
committer | Jon Bratseth <bratseth@verizonmedia.com> | 2019-06-28 06:13:15 -0500 |
commit | 77fa90c39e927df2e3f18afaf359e3882f1b822b (patch) | |
tree | a097460583e4cf8d285c48c5c8ec2a74d1382592 /container-search/src/main/java/com/yahoo/prelude/query/parser/AllParser.java | |
parent | 835688ddc6f02b256dfe12a31b57d761ce66c234 (diff) |
Nonfunctional changes only
Diffstat (limited to 'container-search/src/main/java/com/yahoo/prelude/query/parser/AllParser.java')
-rw-r--r-- | container-search/src/main/java/com/yahoo/prelude/query/parser/AllParser.java | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/container-search/src/main/java/com/yahoo/prelude/query/parser/AllParser.java b/container-search/src/main/java/com/yahoo/prelude/query/parser/AllParser.java index 72ee4ae2c12..d9b969757c2 100644 --- a/container-search/src/main/java/com/yahoo/prelude/query/parser/AllParser.java +++ b/container-search/src/main/java/com/yahoo/prelude/query/parser/AllParser.java @@ -1,7 +1,15 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.prelude.query.parser; -import com.yahoo.prelude.query.*; +import com.yahoo.prelude.query.AndItem; +import com.yahoo.prelude.query.IntItem; +import com.yahoo.prelude.query.Item; +import com.yahoo.prelude.query.NotItem; +import com.yahoo.prelude.query.NullItem; +import com.yahoo.prelude.query.OrItem; +import com.yahoo.prelude.query.PhraseItem; +import com.yahoo.prelude.query.QueryCanonicalizer; +import com.yahoo.prelude.query.RankItem; import com.yahoo.search.query.QueryTree; import com.yahoo.search.query.parser.ParserEnvironment; @@ -86,14 +94,14 @@ public class AllParser extends SimpleParser { return and; } - protected OrItem addOr(Item item,OrItem or) { + protected OrItem addOr(Item item, OrItem or) { if (or == null) or = new OrItem(); or.addItem(item); return or; } - protected NotItem addNot(Item item,NotItem not) { + protected NotItem addNot(Item item, NotItem not) { if (not == null) not = new NotItem(); not.addNegativeItem(item); @@ -129,9 +137,9 @@ public class AllParser extends SimpleParser { // Interpret -N as a positive item matching a negative number (by backtracking out of this) // but not if there is an explicit index (such as -a:b) // but interpret --N as a negative item matching a negative number - if ( item instanceof IntItem && - ((IntItem)item).getIndexName().isEmpty() && - ! ((IntItem)item).getNumber().startsWith(("-"))) + if (item instanceof IntItem && + ((IntItem)item).getIndexName().isEmpty() && + ! ((IntItem)item).getNumber().startsWith(("-"))) item = null; return item; |