use of org.hibernate.search.annotations.Field in project pyramus by otavanopisto.
the class Person method getLastNameSortable.
@Transient
@Field(analyze = Analyze.NO, store = Store.NO)
@SortableField
public String getLastNameSortable() {
Student student = getLatestStudent();
StaffMember staffMember = getStaffMember();
return student != null ? student.getLastName() : staffMember != null ? staffMember.getLastName() : "";
}
use of org.hibernate.search.annotations.Field in project pyramus by otavanopisto.
the class Person method getFirstNameSortable.
@Transient
@Field(analyze = Analyze.NO, store = Store.NO)
@SortableField
public String getFirstNameSortable() {
Student student = getLatestStudent();
StaffMember staffMember = getStaffMember();
return student != null ? student.getFirstName() : staffMember != null ? staffMember.getFirstName() : "";
}
use of org.hibernate.search.annotations.Field in project elide by yahoo.
the class SearchDataTransaction method fieldIsIndexed.
private boolean fieldIsIndexed(Type<?> entityClass, FilterPredicate predicate) {
String fieldName = predicate.getField();
List<Field> fields = new ArrayList<>();
Field fieldAnnotation = dictionary.getAttributeOrRelationAnnotation(entityClass, Field.class, fieldName);
if (fieldAnnotation != null) {
fields.add(fieldAnnotation);
} else {
Fields fieldsAnnotation = dictionary.getAttributeOrRelationAnnotation(entityClass, Fields.class, fieldName);
if (fieldsAnnotation != null) {
Arrays.stream(fieldsAnnotation.value()).forEach(fields::add);
}
}
boolean indexed = false;
for (Field field : fields) {
if (field.index() == Index.YES && (field.name().equals(fieldName) || field.name().isEmpty())) {
indexed = true;
}
}
return indexed;
}
Aggregations