io.zulia.util.QueryHelper Maven / Gradle / Ivy
package io.zulia.util;
import java.util.Collection;
import java.util.function.Function;
import java.util.stream.Collectors;
/**
* Created by mdavis on 3/27/16.
*/
public class QueryHelper {
public final static Function ADD_QUOTES = (s) -> '"' + s + '"';
public static String getOrQuery(String field, Collection values, Function modifier) {
return field + ":" + values.stream().map(modifier).collect(Collectors.joining(" OR "));
}
public static String getOrTerms(Collection values, Function modifier) {
return values.stream().map(modifier).collect(Collectors.joining(" OR "));
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy