Skip to content

Commit

Permalink
HSEARCH-3282 Remove support for explicit facet encoding in the migrat…
Browse files Browse the repository at this point in the history
…ion helper

And assume the encoding is defined by the field type.
  • Loading branch information
yrodiere committed Sep 14, 2020
1 parent 3e5452b commit e130440
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 44 deletions.
Expand Up @@ -14,11 +14,9 @@
import org.hibernate.search.annotations.Analyze;
import org.hibernate.search.annotations.Analyzer;
import org.hibernate.search.annotations.Facet;
import org.hibernate.search.annotations.FacetEncodingType;
import org.hibernate.search.annotations.Facets;
import org.hibernate.search.annotations.Field;
import org.hibernate.search.annotations.Fields;
import org.hibernate.search.annotations.FieldBridge;
import org.hibernate.search.annotations.Indexed;
import org.hibernate.search.annotations.Store;
import org.hibernate.search.testsupport.AnalysisNames;
Expand Down Expand Up @@ -57,9 +55,8 @@ public class Car {

private String make;

@Field(name = CUBIC_CAPACITY_STRING, analyze = Analyze.NO, bridge = @FieldBridge(impl = IntegerBridge.class))
@Facet(name = CUBIC_CAPACITY_STRING_FACET_STRING_ENCODING, forField = CUBIC_CAPACITY_STRING, encoding = FacetEncodingType.STRING)
@Facet(name = CUBIC_CAPACITY_STRING_FACET_NUMERIC_ENCODING, forField = CUBIC_CAPACITY_STRING, encoding = FacetEncodingType.LONG)
@Field
@Facet(name = CUBIC_CAPACITY_STRING_FACET_NUMERIC_ENCODING)
private Integer cubicCapacity;

public Car() {
Expand All @@ -79,6 +76,12 @@ public Integer getCubicCapacity() {
return cubicCapacity;
}

@Field(name = CUBIC_CAPACITY_STRING, analyze = Analyze.NO)
@Facet(name = CUBIC_CAPACITY_STRING_FACET_STRING_ENCODING, forField = CUBIC_CAPACITY_STRING)
public String getCubicCapacityString() {
return cubicCapacity == null ? null : cubicCapacity.toString();
}

public int getId() {
return id;
}
Expand Down
Expand Up @@ -36,9 +36,4 @@
*/
String forField() default "";

/**
* @return the encoding type to use for this facet. Per default the encoding type is chosen based on the type of the
* entity property.
*/
FacetEncodingType encoding() default FacetEncodingType.AUTO;
}

This file was deleted.

0 comments on commit e130440

Please sign in to comment.