1

I have the following indexed documents

{

    "id":"data1",
    "isParent":"1",
    "_childDocuments":[
        {
            "description":"Benefit and Payroll consultant with HR team ",
            "isParent":"2",
            "exp":2
        },
        {
            "description":" ERP Avalon Implementation and Support Payroll",
            "isParent":"2",
            "exp":5
        }
    ]

}

How can I form a query as

select?q=:&fq=(description:Payroll AND sum(exp):7)

and get the parent document id data1 as response.

Please guide me how can I achive the above query and response with my indexed documents

1 Answers1

0

I see two options:

  1. using streaming expressions you should be able to do that
  2. if you want to use vanilla solr queries, then add a field at the parent doc level sumExp containing the sum of all children values and then fq on that
Persimmonium
  • 15,593
  • 11
  • 47
  • 78
  • Thank you for your valuable response.I cann't go with second approach because I need to consider the child document wich should have the specified description.Some child documents may not have it. – user3351289 Jan 12 '18 at 10:26