In FTS, the underscore character is not considered as a word separator, so it doesn’t split the word into separate tokens. That’s why your search doesn’t work. You may try adding the * in the beginning of the search query (see docs) - in this case the search will be performed in any part of the word not from beginning only.
Alternatively, you may try to reconfigure the analyzer in the way that it considers the underscore character as a word separator. You’ll probably need to override the com.haulmont.fts.core.sys.IndexWriterProviderBean. This discussion may be helpful.
You will need to change the com.haulmont.fts.core.sys.EntityAttributeTokenizer class, because it says that underscore is not a token separator:
public class EntityAttributeTokenizer extends CharTokenizer {
public EntityAttributeTokenizer() {
super();
}
protected boolean isTokenChar(int c) {
return FTS.isTokenChar(c);
}
}
public static boolean isTokenChar(int c) {
return Character.isLetterOrDigit(c) || c == '_' || c == '-' || c == '/' || c == '\\' || c == '$' || c == '^';
}