AtlasOfLivingAustralia / avh-hub

Australian Virtual Herbarium
https://avh.ala.org.au
Mozilla Public License 2.0
4 stars 2 forks source link

Sorting by Record date in search results #78

Closed nielsklazenga closed 4 weeks ago

nielsklazenga commented 6 years ago

Sorting search results by Record date gives very confusing results. It appears that records with an incomplete or no event date have been given a Record date of 0, so, when sorting on it, records with an incomplete or missing even date end up between the records from before 1 Jan. 1970 and those from after 1 Jan. 1970, instead of at the end or beginning.

See, for example, http://avh.ala.org.au/occurrences/search?fq=&pageSize=400&sort=occurrence_date&taxa=Cenchrus%20purpurascens.

adam-collins commented 7 months ago

Still an issue.

adam-collins commented 7 months ago

This can be achieved by adding sortMissingLast="true" to the SOLR schema <fieldType name="date" class="solr.DatePointField" omitNorms="true">.

It will result in all date field searches putting the null values at the end.

Since we discourage deep paging this should not be an issue. Need other opinions and to see what it does to charts and facet sorting.

adam-collins commented 7 months ago

Facets are unchanged.

Charting is unchanged because ranges are used when not based on facets.

adam-collins commented 7 months ago

See commit https://github.com/gbif/pipelines/commit/72767b10846d476b8ca9d6b92352924b9bb7675e. It might be a long time before this makes it into production.

nielsklazenga commented 7 months ago

Thanks for looking into this @adam-collins.

adam-collins commented 7 months ago

pull request https://github.com/gbif/pipelines/pull/1035

nickdos commented 1 month ago

Hi @nielsklazenga - can you pls check if this issue has been fixed and close it if it looks OK?

nielsklazenga commented 4 weeks ago

Yup, looks good for example provided.