Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ public class IndexOptions {
private boolean noFields;
private boolean noHL;
private List<String> stopwords;
private List<String> prefixes;

public long getExpire() {
return expire;
Expand Down Expand Up @@ -94,12 +95,27 @@ public IndexOptions stopwords(List<String> stopwords) {
return this;
}

public static IndexOptions defaultOptions() {
public List<String> getPrefixes() {
return prefixes;
}

public IndexOptions prefixes (List<String> prefixes){
this.prefixes = prefixes;
return this;
}

public static IndexOptions defaultOptions() {
return new IndexOptions();
}

public void build(List<Object> args) {
if (isMaxTextFields()) {

if (getPrefixes() != null) {
args.add(Keywords.PREFIX.name());
args.add(getPrefixes().size());
args.addAll(getPrefixes());
}
if (isMaxTextFields()) {
args.add(Keywords.MAXTEXTFIELDS.name());
}
if (getExpire() > 0) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
*/
public enum Keywords {
MAXTEXTFIELDS, TEMPORARY, NOOFFSETS, NOHL, FUZZY, WITHSCORES, WITHPAYLOADS, MAX, PAYLOAD, INCR, LANGUAGE, REPLACE,
DD, FIELDS, IF, NOSAVE, KEEPDOCS, NOINDEX, SORTABLE, PHONETIC, NOSTEM, WEIGHT, SEPARATOR, ADD, SCHEMA, STOPWORDS, NOFREQS, NOFIELDS,
DD, FIELDS, IF, NOSAVE, KEEPDOCS, NOINDEX, SORTABLE, PHONETIC, NOSTEM, WEIGHT, SEPARATOR, ADD, SCHEMA, STOPWORDS, PREFIX, NOFREQS, NOFIELDS,
NOCONTENT, VERBATIM, NOSTOPWORDS, WITHSORTKEYS, FILTER, GEOFILTER, INKEYS, INFIELDS, RETURN, SUMMARIZE, FRAGS, LEN,
HIGHLIGHT, TAGS, SLOP, INORDER, EXPANDER, SCORER, EXPLAINSCORE, SORTBY, LIMIT, AVG, REDUCE, STDDEV, COUNT, COUNT_DISTINCT,
COUNT_DISTINCTISH, SUM, MIN, QUANTILE, TOLIST, FIRST_VALUE, BY, RANDOM_SAMPLE, GROUPBY, LOAD, APPLY, AS, DISTANCE, INCLUDE, EXCLUDE, TERMS;
Expand Down