Gravatar for ncipollina@captechconsulting.com

Question by ncipollina, Sep 25, 2016 9:55 PM

Sort by Distance With Additional Field

I am trying to apply a sort by a date and a $qf distance field. The sort works when sorting on just the date field, but does not additionally sort on the distance field. If I remove the date field and sort only on the distance field, the distance sort works. If I add any other field in addition to distance, the distance sort does not work. Is this intended behavior?

Thanks in advance, Nick

1 Reply
Gravatar for slangevin@coveo.com

Answer by Simon, Sep 26, 2016 9:26 AM

You can usually sort on multiple fields (except Relevancy): https://developers.coveo.com/display/public/SearchREST/Query+Parameters#QueryParameters-sortCriteria

You have an example here: https://answers.coveo.com/questions/2793/can-you-specify-multiple-sortfield-options

How are you applying your sort? Through the REST Search Api? Through JavaScript using our framework? Using a sort component?

Cheers,
Simon

Gravatar for ncipollina@captechconsulting.com

Comment by ncipollina, Sep 26, 2016 9:38 AM

We are setting it via the sortCriteria field. I can tell you it is definitely not honoring the sort by distance after the sort by date or any other field that we have.

Gravatar for slangevin@coveo.com

Comment by Simon, Sep 26, 2016 9:44 AM

I redirected your issue to our support.

Ask a question