简体   繁体   English

休眠搜索@ContainedIn 不适用于布尔字段

[英]hibernate search @ContainedIn not working on boolean fields

I'm trying to index a field in an indexedembedded object and for some reason it's not updating.我正在尝试为 indexedembedded 对象中的字段建立索引,但由于某种原因它没有更新。 I have a convenience retrieval method as the part annotated with @IndexedEmbedded, but the other attribute I'm indexing does seem to trigger a change.我有一个方便的检索方法作为用@IndexedEmbedded 注释的部分,但我正在索引的另一个属性似乎触发了更改。 I'm not sure if I'm missing something.我不确定我是否遗漏了什么。 Here's the basic configuraiton:这是基本配置:

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;
    }
}

If I update myEnum it updates the index and even actually fixes the seemingly lost myBool update.如果我更新 myEnum,它会更新索引,甚至实际上修复了看似丢失的 myBool 更新。 I tried annotating both the field itself and the getter to see if for some reason the potential for null was throwing it off, but that didn't help.我尝试对字段本身和 getter 进行注释,以查看是否由于某种原因 null 的潜力将其抛弃,但这并没有帮助。 I also tried using BooleanBridge on both, but no luck there either.我也尝试在两者上使用 BooleanBridge,但也没有运气。

Thanks to @AndrewRobie, we were able to track the issue and fix it.感谢@AndrewRobie,我们能够跟踪问题并修复它。

See https://hibernate.atlassian.net/browse/HSEARCH-2486 for more information about it.有关它的更多信息,请参阅https://hibernate.atlassian.net/browse/HSEARCH-2486

The fix will be part of our next releases: 5.5.6.Final and 5.6.0.CR1.该修复将成为我们下一个版本的一部分:5.5.6.Final 和 5.6.0.CR1。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM