Class FieldDefinition.FieldDefinitionBuilder

  • Enclosing class:
    FieldDefinition

    public static class FieldDefinition.FieldDefinitionBuilder
    extends Object
    • Method Detail

      • multiValued

        public FieldDefinition.FieldDefinitionBuilder multiValued​(boolean multiValued)
        Whether or not this field should contain a list of values.
        Parameters:
        multiValued - whether this field should contain a list of values
        Returns:
        this.
      • propertyPath

        public FieldDefinition.FieldDefinitionBuilder propertyPath​(String propertyPath)
        The JSON path of this field excluding the root prefix, "$.". This is the path to the actual value that will be stored in the index, e.g. 'price', 'description', 'customer.name', etc.

        For more advanced mapping options, see the JSONPath documentation

        Parameters:
        propertyPath - path to find field's value on indexable object
        Returns:
        this.
      • combined

        public FieldDefinition.FieldDefinitionBuilder combined​(boolean combined)
        Whether or not this field should be a combination of multiple path values. If true, then instead of propertyPath, the multi-valued propertyPaths will be used and joined with the delimiter.
        Parameters:
        combined - whether this field should be a combination of multiple path values
        Returns:
        this.
      • multiValuedCombinedPropertyRootPath

        public FieldDefinition.FieldDefinitionBuilder multiValuedCombinedPropertyRootPath​(String multiValuedCombinedPropertyRootPath)
        For fields which are both multiValued AND combined, this will be path to the list containing the objects representing each value. For example, to combine property paths for each category in a list of all categories in the object being indexed, this would be categories[*].
        Parameters:
        propertyPath - path to find multi-valued combined field's property path root list
        Returns:
        this.
      • propertyPaths

        public FieldDefinition.FieldDefinitionBuilder propertyPaths​(List<String> propertyPaths)
        If this is a combined field, these are the JSON paths to the fields to be combined into the final value, excluding the root prefix, "$.".

        For combined fields, all property paths should point to a single-valued object, the String value of which will be used.

        For fields which are both multiValued AND combined, the root for this path will be an individual object in the list defined by the multiValuedCombinedPropertyRootPath. For example, if the indexable domain was: { "categories": [ { "id": "exampleId", "name": "exampleName" } ] } , and the multiValuedCombinedPropertyRootPath was categories[*], then the propertyPaths might be id or name.

        Parameters:
        propertyPaths - paths to find field's values on indexable object
        Returns:
        this.
      • delimiter

        public FieldDefinition.FieldDefinitionBuilder delimiter​(String delimiter)
        If this is a combined field, this is the delimiter string which should separate the values found from the propertyPaths.
        Parameters:
        delimiter - separator for values combined form propertyPaths
        Returns:
        this.
      • abbreviation

        public FieldDefinition.FieldDefinitionBuilder abbreviation​(String abbreviation)
        Short field name which will be used for request parameters for example in sorting and filtering, as well as response field names.
        Parameters:
        abbreviation - short name for request and response field name
        Returns:
        this.
      • translatable

        public FieldDefinition.FieldDefinitionBuilder translatable​(boolean translatable)
        Indicates if this field is translatable.
        Parameters:
        translatable - whether this field is translatable
        Returns:
        this.
      • faceted

        public FieldDefinition.FieldDefinitionBuilder faceted​(boolean faceted)
        Indicates if this field has a facet.
        Parameters:
        faceted - whether this field has a facet
        Returns:
        this.
      • facetVariantType

        public FieldDefinition.FieldDefinitionBuilder facetVariantType​(String facetVariantType)
        The field variant type which should be faceted on.

        If not provided, the first variant type will be used.

        Parameters:
        facetVariantType - the variant type which should be faceted on
        Returns:
        this.
      • sortable

        public FieldDefinition.FieldDefinitionBuilder sortable​(boolean sortable)
        Indicates if this field is sortable.
        Parameters:
        sortable - whether this field is sortable
        Returns:
        this.
      • sortVariantType

        public FieldDefinition.FieldDefinitionBuilder sortVariantType​(String sortVariantType)
        The field variant type which should be sorted on.

        If not provided, the first variant type will be used.

        Parameters:
        sortVariantType - the variant type which should be sorted on
        Returns:
        this.
      • searchable

        public FieldDefinition.FieldDefinitionBuilder searchable​(boolean searchable)
        Whether or not the search query should be applied to this field on search.
        Parameters:
        searchable - should search query be applied on this field
        Returns:
        this.
      • fieldQueries

        public FieldDefinition.FieldDefinitionBuilder fieldQueries​(List<FieldQuery> fieldQueries)
        Defines how this field should be queried by variants on particular query types.
        Parameters:
        fieldQueries - the variant level field queries
        Returns:
        this.