src/main/java/io/chatpal/solr/ext/handler/QueryHelper.java
/**
     * Builds a query that requires one of the parsed terms by using the Solr terms
     * query parser.
     * @param field the field. MUST NOT be <code>null</code> nor blank
     * @param values the values
     * @return the terms filter
     * @throws IllegalArgumentException if <code>null</code> or blank is parsed as field
     * @see <a href="https://lucene.apache.org/solr/guide/7_2/other-parsers.html#terms-query-parser">https://lucene.apache.org/solr/guide/7_2/other-parsers.html#terms-query-parser</a>
     */
Builds a query that requires one of the parsed terms by using the Solr terms
query parser.
@param field the field.
Builds a query that requires one of the parsed terms by using the Solr terms query parser . @param field the field .
public static String buildTermsQuery(String field, String[] values){
        if(StringUtils.isBlank(field)){
            throw new IllegalArgumentException("The parsed field MUST NOT be NULL nor blank");
        }
        if (values == null) {
            values = new String[0];
        }
        return String.format("{!terms f=%s}", field) +
                Arrays.stream(values)
                        .filter(StringUtils::isNotBlank)
                        .collect(Collectors.joining(","));
    }
public static String buildTermsQuery ( String field , String [ ] values ) { if ( StringUtils . isBlank ( field ) ) { throw new IllegalArgumentException ( "The parsed field MUST NOT be NULL nor blank" ) ; } if ( values == null ) { values = new String [ 0 ] ; } return String . format ( "{!terms f=%s}" , field ) + Arrays . stream ( values ) . filter ( StringUtils :: isNotBlank ) . collect ( Collectors . joining ( "," ) ) ; }
Builds a query that requires one of the parsed terms by using the Solr terms
 query parser.
Builds a query that requires one of the parsed terms by using the Solr terms query parser .
//NOTE: we create an empty terms filter if no values are parsed