![](/img/trans.png)
[英]java - Hibernate Search - Unable to perform work. Entity Class is not @Indexed nor hosts @ContainedIn
[英]hibernate search @ContainedIn not working on boolean fields
我正在嘗試為 indexedembedded 對象中的字段建立索引,但由於某種原因它沒有更新。 我有一個方便的檢索方法作為用@IndexedEmbedded 注釋的部分,但我正在索引的另一個屬性似乎觸發了更改。 我不確定我是否遺漏了什么。 這是基本配置:
ClassA {
List<ClassB> myList = new ArrayList<>();
@IndexedEmbedded
ClassB getNewestClassB() {
//sort by creationDate and return last
}
}
ClassB {
@Field
enum myEnum;
@Field
Boolean myBool; //Boolean to avoid null issues
@ContainedIn
ClassA
boolean getMyBool() {
if(myBool == null)
return false;
return myBool;
}
}
如果我更新 myEnum,它會更新索引,甚至實際上修復了看似丟失的 myBool 更新。 我嘗試對字段本身和 getter 進行注釋,以查看是否由於某種原因 null 的潛力將其拋棄,但這並沒有幫助。 我也嘗試在兩者上使用 BooleanBridge,但也沒有運氣。
感謝@AndrewRobie,我們能夠跟蹤問題並修復它。
有關它的更多信息,請參閱https://hibernate.atlassian.net/browse/HSEARCH-2486 。
該修復將成為我們下一個版本的一部分:5.5.6.Final 和 5.6.0.CR1。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.