Can Solr facet on a particular element in a list

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Can Solr facet on a particular element in a list

Wendy2
Hi Solr Users,

Can Solr facet on a particular element in a list?
For example, I have a list with 4 elements as below.  Is it possible to
facet on the individual element?
facet on  rcsb_enzyme_lineage.name(0), rcsb_enzyme_lineage.name(1), etc??    
Thanks!

"rcsb_enzyme_lineage.name":["NAD(+) glycohydrolase",
          "Hydrolases",
          "Hydrolyzing N-glycosyl compounds",
          "Glycosylases"],



--
Sent from: http://lucene.472066.n3.nabble.com/Solr-User-f472068.html
Reply | Threaded
Open this post in threaded view
|

Re: Can Solr facet on a particular element in a list

Erick Erickson
In a word, “no”.

Assuming these are String fields. You’d have to do something like index to multiple fields, i.e.

rcsb_enzyme_lineage.name1":"NAD(+) glycohydrolase"
rcsb_enzyme_lineage.name2":"Hydrolases"
rcsb_enzyme_lineage.name3":"Hydrolyzing N-glycosyl compounds"
rcsb_enzyme_lineage.name4":"Glycosylases”

then, since you know the position facet on “the right one”, with obvious index bloat consequences.

And do be aware that in the single-field case, and again assuming multiValued, docValues fields will collapse identical fields and sort them.

Best,
Erick



> On Mar 26, 2019, at 6:37 PM, Wendy2 <[hidden email]> wrote:
>
> Hi Solr Users,
>
> Can Solr facet on a particular element in a list?
> For example, I have a list with 4 elements as below.  Is it possible to
> facet on the individual element?
> facet on  rcsb_enzyme_lineage.name(0), rcsb_enzyme_lineage.name(1), etc??    
> Thanks!
>
> "rcsb_enzyme_lineage.name":["NAD(+) glycohydrolase",
>          "Hydrolases",
>          "Hydrolyzing N-glycosyl compounds",
>          "Glycosylases"],
>
>
>
> --
> Sent from: http://lucene.472066.n3.nabble.com/Solr-User-f472068.html

Reply | Threaded
Open this post in threaded view
|

Re: Can Solr facet on a particular element in a list

Wendy2
Hi Erick,

Thank you very much for your response!  OK, I understand what you mean and
will flaten the list into multiple fields.

Thanks!




--
Sent from: http://lucene.472066.n3.nabble.com/Solr-User-f472068.html