FieldBridge for Timestamp in Hibernate Search
-
09-09-2019 - |
Question
What is the FieldBridge for timestamp in HIbernate Search?
@Field
public java.sql.Timestamp approvedDate;
Solution
When looking at the BridgeFactory source code, it seems there is no default FieldBridge for timestamps.
I think you should provide your own custom FieldBridge.
OTHER TIPS
Long story short, here is what I use:
@Field(index=Index.UN_TOKENIZED)
@DateBridge(resolution=Resolution.MILLISECOND)
public Timestamp getCreated(){
return super.getCreated();
}
and the good thing it is working fine :)
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow