dasch-swiss / beol

Bernoulli-Euler OnLine
https://beol.dasch.swiss
GNU Affero General Public License v3.0
0 stars 1 forks source link

Search Results #78

Closed tobiasschweizer closed 5 years ago

tobiasschweizer commented 5 years ago

An extended search is performed by creating the Gravsearch query string using the service ExtendedSearchParams. This service used to return an Observable of a BehaviorSubject which was both unnecessary and harmful. It caused a lot of unclosed subscriptions, so that the same queries were performed over and over again.

requires https://github.com/dhlab-basel/Knora-ui/pull/133 (has been merged)

I refactored paging logic a bit. The max. offset is

this.maxOffset = Math.floor((this.numberOfAllResults - 1) / environment.pagingLimit);

paging limit is 25, first offset is 0.

If we have 25 overall results, the max. offset is 0. If we we have 24 overall results, the max. offset is 0. If we have 26 overall results, the max. offset is 1.

close #27 relates to #70

tobiasschweizer commented 5 years ago

Once https://github.com/dhlab-basel/Knora-ui/issues/136 is done, we can write better tests (there is no promise to be handled inside the component anymore).