Ford Filer
Ford Filer

Reputation: 325

Facet on multiple fields at once and aggregate the results

I have a couple fields that represent error codes, they take the form error_code1, error_code2 ... error_code5.

Is there a way to facet across all of them so that I can get a count of error codes across all of the error code fields?

If one doc has error_code1 = 42 and another has error_code3 = 42, I want to get a count of 2 for error code 42

Thanks in advance

Upvotes: 0

Views: 395

Answers (1)

user95338
user95338

Reputation: 76

You can create an aggregating field all_errors and use <copyField source="error_code*" dest="all_errors" /> to populate it.

Upvotes: 1

Related Questions