AtlasOfLivingAustralia / la-pipelines

Living Atlas Pipelines extensions
3 stars 4 forks source link

`/explore/group/{group}.json` output shows repeated taxa (EYA broken pagination) #467

Closed nickdos closed 3 years ago

nickdos commented 3 years ago

Bug reported by a user - https://support.ehelp.edu.au/a/tickets/111300.

When scrolling through list of species in EYA, the list is paginated at 50 items and user can extend the list by clicking on the "show more species" link at end of the list.

image

The list of taxa is generated from this following call (first 50 items)

https://biocache-ws.ala.org.au/ws/explore/group/Birds.json?lat=-35.2513&lon=149.1635&radius=5&fq=geospatial_kosher%3Atrue&qc=&sort=count&pageSize=50

Clicking the "show more species" link, calls the same service but adds &start=50 to the request:

https://biocache-ws.ala.org.au/ws/explore/group/Birds.json?lat=-35.2513&lon=149.1635&radius=5&fq=geospatial_kosher%3Atrue&start=50&common=false&sort=index&pageSize=50&qc=

The problem is that taxa in the first 50 are reappearing in subsequent paginated requests, when &start=50 is added. E.g. item 2 from the second call is already present as item 34 in the first call. SO the users sees the same species appearing over and over in the list.

Requesting the 3rd, 4th and subsequent pages, simply returns the same results as page 2, e.g.

https://biocache-ws.ala.org.au/ws/explore/group/Birds.json?lat=-35.2513&lon=149.1635&radius=5&fq=geospatial_kosher%3Atrue&start=100&common=false&sort=index&pageSize=50&qc=

is the same as the link above it.

It also seems that the sorting is broken when start is provided, as the count values should decrease but they are completely inconsistent: 1, 3317, 9435, 1, etc. and items appear to be sorted by taxon name.

timhicks-ala commented 3 years ago

Additionally reported in helpdesk tickets 111246, 111339 and 111354.

111421

adam-collins commented 3 years ago

https://github.com/AtlasOfLivingAustralia/biocache-service/pull/656

djtfmartin commented 3 years ago

This looks fixed to me in the test environment. Can someone else verify ?

nickdos commented 3 years ago

Not fixed for me on https://biocache-dq-test.ala.org.au/explore/your-area#-35.2730|149.1163|12|Birds

image

Sort order is broken after entry #50 in list (count should be decreasing but is random).

nickdos commented 3 years ago

@adam-collins pointed out that EYA is not sending the correct sort param so needs a fix there.

adam-collins commented 3 years ago

Hubs is sending inconsistent sort values. In the screenshot records <=50 are sort=count and the appended records are sort=index or sort=taxa.

nickdos commented 3 years ago

~So count is a invalid value?~ forget that.

nickdos commented 3 years ago

@adam-collins - with a minor fix in hubs, this is now working as expected for the default sort order count but its not working for sorting by commonName. The way that was working, was it sent these params common=true&sort=index but now that simply returns results sorted by scientificName, so seems the common=true is being ignored. Can you take a look please?

nickdos commented 3 years ago

Can someone pls code review the commit above?

adam-collins commented 3 years ago

https://github.com/AtlasOfLivingAustralia/biocache-service/pull/663 fixes common=true&sort=index

nickdos commented 3 years ago

UI fix (ala-hub) deployed to test site. Dave deployed latest biocache-service.

All bugs appear to be fixed. Can someone else check this please?

alexhuang091 commented 3 years ago

@nickdos

https://biocache-ws.ala.org.au/ws/explore/group/Birds.json?lat=-35.2513&lon=149.1635&radius=5&fq=geospatial_kosher%3Atrue&qc=&sort=count&pageSize=50

https://biocache-ws.ala.org.au/ws/explore/group/Birds.json?lat=-35.2513&lon=149.1635&radius=5&fq=geospatial_kosher%3Atrue&qc=&sort=count&pageSize=50&start=100

these 2 queries return exactly same content which is not expected.


Sorry my fault, it's the production url