mvallebr
mvallebr

Reputation: 2508

Inserting a POJO tree using SOLRJ

I am currently following these instructions to add data to SOLR: http://wiki.apache.org/solr/Solrj#Directly_adding_POJOs_to_Solr

However, I have a bean attribute that is another class. Something like bellow. Is it possible to index that the same way? I am not sure on how to config solr for that.

public class User {
    @Field
    String id;

    @Field("cat")
    List<Category> categories;
}

public class Category {
    @Field
    String id;

    @Field
    String name;
}

Upvotes: 0

Views: 442

Answers (1)

Paige Cook
Paige Cook

Reputation: 22555

Unfortunately, complex types are not supported with SolrJ only simple types. Please see this previous question - solrj: how to store and retrieve List via multivalued field in index as well as the open issue SOLR-1945

Upvotes: 1

Related Questions