Hi everyone,

We have two multi-valued fields, both containing usernames, and we'd like to 
compute the combined counts across both fields. For example, if we were to 
facet on these two docs:

doc1: { field1: [user1, user2], field2: [user3, user4] }
doc2: { field1: [user1, user3], field2: [user2] }

we'd expect the following counts:

user1: 2
user2: 2
user3: 2
user4: 1

I know one option is to create a new field that combines the two and facet on 
that, but these lists can be large and we could have millions of unique users, 
so we're looking at implementing a custom facet processor to avoid duplicating 
data. Looks like one way would be to subclass SimpleFacets and register a new 
FacetComponent, but this seems to use the legacy faceting methods. Is there a 
way to do something similar with the JSON API? Is this even advisable?

Thanks,
Julia

Reply via email to