2

I have a set of Solr documents with children, and each child has a startDate_dt and an endDate_dt, and I want my queries to only return valid children, i.e. children for which the current date is between the start date and the end date.

Since I'm already using the ChildDocTransformer I was hoping I'd be able to set the childFilter to a date range in the fl field:

*, [child parentFilter=docType:"VEHICLE" childFilter=promotion.startDate_dt:[2018-04-03T00:00:00Z TO *] AND promotion.endDate_dt:[* TO 2018-04-03T23:00:00Z]]

But it doesn't seem to work as I'm getting an exception with message error parsing fieldname.

I tried filtering for a single value, i.e.

*, [child parentFilter=docType:"VEHICLE" childFilter=promotion.startDate_dt:"2018-04-03T00:00:00Z"]

And it works properly, so I'm guessing there's an issue in the syntax I'm using to specify date ranges.

What am I missing? Is there a way to filter child documents by date ranges?

Raibaz
  • 9,280
  • 10
  • 44
  • 65
  • 1
    I believe if you have multiple fields you need to wrap the childFilter in quotations so it'd be like childFIlter="promotion.startDate_dt:[your ranges] AND promotion.endDate_dt:[your ranges]" – gcalex5 May 01 '18 at 13:33
  • Any updates around this ? Facing similar issue – Harshit Apr 30 '20 at 08:01

0 Answers0