use of org.hibernate.search.mapper.pojo.mapping.definition.programmatic.TypeMappingStep in project hibernate-search by hibernate.
the class RoutingBridgeRoutingKeyIT method params.
@Parameterized.Parameters(name = "{0}")
public static List<?> params() {
return DocumentationSetupHelper.testParamsForBothAnnotationsAndProgrammatic(BackendConfigurations.hashBasedSharding(SHARD_COUNT), mapping -> {
// tag::programmatic[]
TypeMappingStep bookMapping = mapping.type(Book.class);
bookMapping.indexed().routingBinder(new BookGenreRoutingBinder());
bookMapping.property("genre").keywordField();
// end::programmatic[]
});
}
use of org.hibernate.search.mapper.pojo.mapping.definition.programmatic.TypeMappingStep in project hibernate-search by hibernate.
the class RoutingBridgeConditionalIndexingIT method params.
@Parameterized.Parameters(name = "{0}")
public static List<?> params() {
return DocumentationSetupHelper.testParamsForBothAnnotationsAndProgrammatic(BackendConfigurations.simple(), mapping -> {
// tag::programmatic[]
TypeMappingStep bookMapping = mapping.type(Book.class);
bookMapping.indexed().routingBinder(new BookStatusRoutingBinder());
bookMapping.property("status").keywordField();
// end::programmatic[]
});
}
use of org.hibernate.search.mapper.pojo.mapping.definition.programmatic.TypeMappingStep in project hibernate-search by hibernate.
the class ValueBridgeBinderIT method params.
@Parameterized.Parameters(name = "{0}")
public static List<?> params() {
return DocumentationSetupHelper.testParamsForBothAnnotationsAndProgrammatic(BackendConfigurations.simple(), mapping -> {
// tag::programmatic[]
TypeMappingStep bookMapping = mapping.type(Book.class);
bookMapping.indexed();
bookMapping.property("isbn").genericField().valueBinder(new ISBNValueBinder()).sortable(Sortable.YES);
// end::programmatic[]
});
}
use of org.hibernate.search.mapper.pojo.mapping.definition.programmatic.TypeMappingStep in project hibernate-search by hibernate.
the class ContainerExtractorIT method params.
@Parameterized.Parameters(name = "{0}")
public static List<?> params() {
return DocumentationSetupHelper.testParamsForBothAnnotationsAndProgrammatic(BackendConfigurations.simple(), mapping -> {
TypeMappingStep bookMapping = mapping.type(Book.class);
bookMapping.indexed();
// tag::programmatic-extractor[]
bookMapping.property("priceByFormat").genericField("availableFormats").extractor(BuiltinContainerExtractors.MAP_KEY);
// end::programmatic-extractor[]
// tag::programmatic-noExtractors[]
bookMapping.property("authors").genericField("authorCount").valueBridge(new MyCollectionSizeBridge()).noExtractors();
// end::programmatic-noExtractors[]
});
}
use of org.hibernate.search.mapper.pojo.mapping.definition.programmatic.TypeMappingStep in project hibernate-search by hibernate.
the class TypeBridgeParamIT method params.
@Parameterized.Parameters(name = "{0}")
public static List<?> params() {
return DocumentationSetupHelper.testParamsForBothAnnotationsAndProgrammatic(BackendConfigurations.simple(), mapping -> {
// tag::programmatic[]
TypeMappingStep authorMapping = mapping.type(Author.class);
authorMapping.indexed();
authorMapping.binder(new FullNameBinder().sortField(true));
// end::programmatic[]
});
}
Aggregations