atomic-server icon indicating copy to clipboard operation
atomic-server copied to clipboard

Should sorting filter a value?

Open joepio opened this issue 4 years ago • 1 comments

Because of how I've implemented sorting, sorting now results in a filtered list. If the sorter property value is not present in a resource, it will be left out of the collection.

example: https://atomicdata.dev/collections?sort_by=https%3A%2F%2Fatomicdata.dev%2Fproperties%2Fdescription

Question is: is this OK? Is this what users will expect? I know it's not what I tested for in the sort functions themselves, it's a side effect happening in the Query Index.

On extra complex situation, is with false boolean values. I've decided to interpret no value to be the same as false, so when you sort a boolean value, you only see true values.

joepio avatar Jan 26 '22 15:01 joepio

In my opinion they shouldn't be filtered out. If the prop is not present on the resource it should simply be moved to the end (or start when sort_desc is set).

Implementing this might not be that easy because if the resources does not have a value for the sorted prop, it won't actually be present in the index

Polleps avatar Jul 31 '25 14:07 Polleps