views:

238

answers:

1

I am indexing a class whose superclass has the following annotations:

@Indexed
@Entity
@Inheritance(strategy = InheritanceType.JOINED)

The same @Inheritance annotation is on the subclass. The annotations of the superclass are all on methods. The field I want indexed on the superclass is ignored:


@Field(index=Index.UN_TOKENIZED,store=Store.YES)
@FieldBridge(impl=org.hibernate.search.bridge.builtin.BooleanBridge.class)
@Type(type="yes_no")
public boolean isFlagged() {
    return flagged;
}

The superclass only has the flagged property and the ID. The ID shows up fine, because it has the @Id annotation, but I'm not sure why flagged is not indexed. I found this post but it doesn't give a clear answer. What could I be doing wrong?

A: 

Do you have the @Indexed annotation also on the subclass? You should. It would probably help if you post the fully annotated super- and sub-class code. The @FieldBridge annotation on isFlagged is unnecessary. BooleanBridge is the default.

BTW, you might have more luck with this question on the Hibernate Search Forum.

--Hardy

Hardy
Thanks for the tip. @Indexed is on both super and sub classes. I'll see if I can get a small sample and post it.
User1