Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sorting by Record date in search results #78

Open
nielsklazenga opened this issue Nov 27, 2017 · 6 comments
Open

Sorting by Record date in search results #78

nielsklazenga opened this issue Nov 27, 2017 · 6 comments
Assignees

Comments

@nielsklazenga
Copy link
Contributor

nielsklazenga commented Nov 27, 2017

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:https://avh.ala.org.au/occurrences/search?fq=&pageSize=400&sort=occurrence_date&taxa=Cenchrus%20purpurascens.

@adam-collins
Copy link
Contributor

Still an issue.

@adam-collins adam-collins self-assigned this Feb 7, 2024
@adam-collins
Copy link
Contributor

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.

  • Sorting eventDate desc puts nulls at the end
  • Sorting eventDate asc puts nulls 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
Copy link
Contributor

Facets are unchanged.

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

@adam-collins
Copy link
Contributor

See commit gbif/pipelines@72767b1. It might be a long time before this makes it into production.

@nielsklazenga
Copy link
Contributor Author

Thanks for looking into this @adam-collins.

@adam-collins
Copy link
Contributor

pull request gbif/pipelines#1035

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants