diff options
Diffstat (limited to 'container-search/src/main/java/com/yahoo/prelude/query/PrefixItem.java')
-rw-r--r-- | container-search/src/main/java/com/yahoo/prelude/query/PrefixItem.java | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/container-search/src/main/java/com/yahoo/prelude/query/PrefixItem.java b/container-search/src/main/java/com/yahoo/prelude/query/PrefixItem.java new file mode 100644 index 00000000000..9c3a88178f7 --- /dev/null +++ b/container-search/src/main/java/com/yahoo/prelude/query/PrefixItem.java @@ -0,0 +1,32 @@ +// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +package com.yahoo.prelude.query; + + +/** + * A word which matches beginnings of words instead of complete words + * + * @author bratseth + */ +public class PrefixItem extends WordItem { + + public PrefixItem(String prefix) { + this(prefix, false); + } + + public PrefixItem(String prefix, boolean isFromQuery) { + super(prefix, isFromQuery); + } + + public ItemType getItemType() { + return ItemType.PREFIX; + } + + public String getName() { + return "PREFIX"; + } + + public String stringValue() { + return getWord() + "*"; + } + +} |