faceted search - Using solr facet pivot field in sub query -


i have set of documents similar parent child relation, except not indexed nested - denormalized. below set of records

id,parent_id,,author

1,0,a1

2,1,a2

3,1,a3

4,1,a4

5,0,a5

6,5,a6

7,5,a7

8,0,a8

9,8,a9

10,0,a10

the above records id 1,5,8,10 parent records(parent_id=0) , others child(their parent_id value parent)

my solr query should facet based on parent_id child records, use pivot parent_id , match id author of parent

need combine below 2 queries one

query 1: fq=-parent_id:0&facet=true;facet.pivot=parent_id

from above query if 3 parent ids result of faceting - 1,5,8,10

query 2: fl=author&fq=parent_id in {1,5,8,10}

finally output should a1,a5,a8,a10 - ideally need top author a1 have 4 children

i tried local parameters option, faceting etc. not able find way combine output of facet query, , use in query - in 1 go.

restrictions - not able nest documents use block join. appreciated. thank you

fq={!join from=parent_id to=id}-parent_id:0&facet=true&facet.field=author 

so -parent_id:0 : give results apart 1,5,8,10 , join return documents corresponding 1,5,8,10 . join returns documents to join done, when apply facet resultant facets on 1,5,8,10 docs giving required resultset.


Comments

Popular posts from this blog

multithreading - Exception in Application constructor -

React Native allow user to reorder elements in a scrollview list -

windows - CertCreateCertificateContext returns CRYPT_E_ASN1_BADTAG / 8009310b -