1

I am trying to build hibernate full text search for a nodeEntity. It gives:

Can't build query for type x.y.z.Object which is neither configured nor has any configured sub-types

My class is like below. I am using Neo4j database.

@NodeEntity
@Getter
@Setter
public class ClassName {

    @Index
    private String xyzId;

    @Index
    @Field(index = org.hibernate.search.annotations.Index.YES, analyze = Analyze.NO, store = Store.YES)
    private String xyz;
}
Bruno Peres
  • 15,845
  • 5
  • 53
  • 89
Abdullah Al Noman
  • 2,817
  • 4
  • 20
  • 35

1 Answers1

0

To make any Hibernate entity managed by Hibernate Search you have to mark it with org.hibernate.search.annotations.Indexed.

So you're missing two things:

  1. it must be an entity managed by Hibernate ORM (or OGM)
  2. it's missing the @Indexed annotation on ClassName.

Your example looks like it's using a Neo4J native mapping; that won't work. You might want to look into Hibernate OGM, which makes it possible to store actual Hibernate entities into NoSQL databases, including Neo4J.

Sanne
  • 6,027
  • 19
  • 34