sanghavi7
sanghavi7

Reputation: 754

Apache solr : Put Multiple Field values together

I want to group on multiple fields(5 fields). In solr for that I dont know what to do!. But I got Idea that if I merge all my five fields together as single field value with delimnator char is "~". then if I group on that field, I can get result.

But for this merging all fields together what I have to do, anyone plz?

Upvotes: 0

Views: 808

Answers (1)

Srikanth Venugopalan
Srikanth Venugopalan

Reputation: 9049

In order to group by multiple fields, this is probably the easiest way to do, but it requires that you have a static group clause i.e. the fields for grouping are pre-determined.

In order to do this, you need to create a new field in your schema.xml and map it to a concatenated value of the fields at the time of indexing.

If you are using DataImportHandler, you could use the ScriptTransformer to compute this field's value.

Upvotes: 1

Related Questions