All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.sphere.sdk.search.model.FacetedSearchSearchModel Maven / Gradle / Ivy

The newest version!
package io.sphere.sdk.search.model;

import io.sphere.sdk.search.TermFacetedSearchExpression;

/**
 * Model to build facets and filters.
 * @param  type of the resource
 */
public interface FacetedSearchSearchModel {

    /**
     * The search model for the faceted search.
     * @return the faceted search model
     */
    SearchModel getSearchModel();

    /**
     * Generates an expression to select all elements, without filtering, along with the facet for all terms for this attribute.
     * @return a bundle of an empty filter expression and a facet expression for all terms
     */
    TermFacetedSearchExpression allTerms();

    /**
     * Generates an expression to select all elements with the given attribute value, along with the facet for all terms for this attribute.
     * For example: filtering by "red" color would select only those elements with "red" value, while the color facet would contain all possible values.
     * @param value the value to filter by
     * @return a bundle of the filter expressions for the given value and a facet expression for all terms
     */
    TermFacetedSearchExpression is(final String value);

    /**
     * Generates an expression to select all elements with attributes matching any of the given values, along with the facet for all terms for this attribute.
     * For example: filtering by ["red", "blue"] color would select only those elements with either "red" or "blue" value, while the color facet would contain all possible values.
     *
     * 

Alias for {@link #containsAny(Iterable)}.

* * @param values the values to filter by * @return a bundle of the filter expressions for the given values and a facet expression for all terms */ default TermFacetedSearchExpression isIn(final Iterable values) { return containsAny(values); } /** * Generates an expression to select all elements with attributes matching any of the given values, along with the facet for all terms for this attribute. * For example: filtering by ["red", "blue"] color would select only those elements with either "red" or "blue" value, while the color facet would contain all possible values. * @param values the values to filter by * @return a bundle of the filter expressions for the given values and a facet expression for all terms */ TermFacetedSearchExpression containsAny(final Iterable values); /** * Generates an expression to select all elements with attributes matching all the given values, along with the facet for all terms for this attribute. * For example: filtering by ["red", "blue"] color would select only those elements with both "red" and "blue" values, while the color facet would contain all possible values. * @param values the values to filter by * @return a bundle of the filter expressions for the given values and a facet expression for all terms */ TermFacetedSearchExpression containsAll(final Iterable values); }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy