0

I am doing collapse on itemId like - {!collapse field=itemId nullPolicy=expand} . Its working as expected . So when it is doing the collpase it is showing me one result for itemID -123 that is fine , but in my dataset I have a field called defaultItemID which can be Y or N , and there will be only one defaultItemID:Y per itemID

Example - if I have a itemID - 123, and there are 20 results for itemID- 123 ,and out of those 20 records there will be only one item whose defaultItemID will be Y)

I want solr to return the the record where defaultItemID is Y , when doing the collapse , Is there anyway I can modify my collapse to do that . I tried sort but it was sorting the resut which were coming on exapanded.

2
  • Did you use sort as a parameter to the collapse localparam or as a global sort? I didn't think using it as a localparam ({!collapse field=itemId nullPolicy=expand sort=defaultItemID desc} would affect the global order. There is also a separate expand.sort parameter you can use to order the expanded documents if they are affected.
    – MatsLindh
    Mar 14, 2018 at 14:33
  • @MatsLindh no luck . I tried this before also , it is not displaying the item where defaultItemID is Y . I tried asc and desc both Mar 15, 2018 at 9:45

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.