}
private String buildSearchTerm(FieldContext fieldContext, DocumentBuilderIndexedEntity documentBuilder, ConversionContext conversionContext) {
if ( fieldContext.isIgnoreFieldBridge() ) {
if ( value == null ) {
throw new SearchException(
"Unable to search for null token on field "
+ fieldContext.getField() + " if field bridge is ignored."
);
}
String stringform = value.toString();
if ( stringform == null ) {
throw new SearchException(
"When ignoreFieldBridge() is enabled, toString() on the value is used: the returned string must not be null: " +
"on field " + fieldContext.getField() );
}
return stringform;
}