@Test @DisplayName("Blank field values return an empty clause") void testEmptyValuesInBooleanQuery() { assertThat(SolrQueryUtils.createOrBooleanQuery(FIELD1, ImmutableSet.of())) .isEqualTo(SolrQueryUtils.createOrBooleanQuery(FIELD1, ImmutableSet.of(""))) .isEqualTo(SolrQueryUtils.createOrBooleanQuery(FIELD1, ImmutableSet.of(" "))) .isEqualTo(SolrQueryUtils.createOrBooleanQuery(FIELD1, ImmutableSet.of(" ", "\t"))) .isEqualTo(SolrQueryUtils.createOrBooleanQuery(FIELD1, ImmutableSet.of(" ", "\t", "\n"))) .isEqualTo(SolrQueryUtils.createOrBooleanQuery(FIELD1, ImmutableSet.of(" ", "\t", "\n", "\r"))) .isEqualTo(SolrQueryUtils.createOrBooleanQuery(FIELD1, ImmutableSet.of(" \t\n "))) .isEmpty(); }
public static String createOrBooleanQuery(SchemaField field, Collection<String> values) { return values.stream().anyMatch(StringUtils::isNotBlank) ? String.format( STANDARD_QUERY_PARSER_FIELD_QUERY_TEMPLATE, field.name(), values.stream() .filter(StringUtils::isNotBlank) .map(SolrQueryUtils::normalize) .distinct() .collect(joining(" OR "))) : ""; }
SolrQueryUtils { public static String createOrBooleanQuery(SchemaField field, Collection<String> values) { return values.stream().anyMatch(StringUtils::isNotBlank) ? String.format( STANDARD_QUERY_PARSER_FIELD_QUERY_TEMPLATE, field.name(), values.stream() .filter(StringUtils::isNotBlank) .map(SolrQueryUtils::normalize) .distinct() .collect(joining(" OR "))) : ""; } }
SolrQueryUtils { public static String createOrBooleanQuery(SchemaField field, Collection<String> values) { return values.stream().anyMatch(StringUtils::isNotBlank) ? String.format( STANDARD_QUERY_PARSER_FIELD_QUERY_TEMPLATE, field.name(), values.stream() .filter(StringUtils::isNotBlank) .map(SolrQueryUtils::normalize) .distinct() .collect(joining(" OR "))) : ""; } protected  SolrQueryUtils(); }
SolrQueryUtils { public static String createOrBooleanQuery(SchemaField field, Collection<String> values) { return values.stream().anyMatch(StringUtils::isNotBlank) ? String.format( STANDARD_QUERY_PARSER_FIELD_QUERY_TEMPLATE, field.name(), values.stream() .filter(StringUtils::isNotBlank) .map(SolrQueryUtils::normalize) .distinct() .collect(joining(" OR "))) : ""; } protected  SolrQueryUtils(); static String createOrBooleanQuery(SchemaField field, Collection<String> values); static String createLowerBoundRangeQuery(SchemaField field, double min); static String createUpperBoundRangeQuery(SchemaField field, double max); static String createDoubleBoundRangeQuery(SchemaField field, double min, double max); }
SolrQueryUtils { public static String createOrBooleanQuery(SchemaField field, Collection<String> values) { return values.stream().anyMatch(StringUtils::isNotBlank) ? String.format( STANDARD_QUERY_PARSER_FIELD_QUERY_TEMPLATE, field.name(), values.stream() .filter(StringUtils::isNotBlank) .map(SolrQueryUtils::normalize) .distinct() .collect(joining(" OR "))) : ""; } protected  SolrQueryUtils(); static String createOrBooleanQuery(SchemaField field, Collection<String> values); static String createLowerBoundRangeQuery(SchemaField field, double min); static String createUpperBoundRangeQuery(SchemaField field, double max); static String createDoubleBoundRangeQuery(SchemaField field, double min, double max);  }