Comments (8)
Documentation pending in loklak_server. Changes need to roll out for pagination support in all the SDK Wrappers on Python, Ruby, PHP and Go
from loklak_search.
@mariobehling I'd like take up this.
Is the feed count limited to only 10 per a query string?
from loklak_search.
@pranayyelugam
I wrote This 10 query per page limit. It can be adjusted, in src/app/shared/services/search/search.service.ts
.
I put up that limit to ensure fast loading of results
Can you please share the approach which you will take for making this ??
@mariobehling
Is there any backend pagination available in loklak server
?
from loklak_search.
Is there any backend pagination available in loklak server?
Not yet.
@Orbiter Is that something we want in the server?
from loklak_search.
pagination is now implemented, for query parameters the SRU 2.0 standard was implemented.
See loklak/loklak_server@92f8fe3
I.e.:
first page:
http://loklak.org/api/search.json?timezoneOffset=-60&q=singapore&startRecord=1&maximumRecords=10
second page:
http://loklak.org/api/search.json?timezoneOffset=-60&q=singapore&startRecord=10&maximumRecords=10
from loklak_search.
Hi,
I am thinking of ways to implement this. Practically there are two solutions possible.
-
Infinite Scroll List (Auto loading / load more on click button)
-
Basic Paginiation With page buttons.
There are Pros and cons of both the approaches.
Infinite Scroll list
-
Pros :
-
Easy to implement in current situation with
ngrx/store
-
Easy filtering implementation once (video/images/news etc) filters are implemented as we will just have one continuous data source. (One array of responses)
-
Thus will be helpful and easier to implement initially.
-
-
Cons :
- When we implement the infinite scroll type once the no of elements become too high it leads to performance bottlenecks as browser is unable to render such high no of components. Now the threshold for this will be approximately when we have 300-400 components (On slower devices taking the worst case).
-
Workarounds
- Now there is workaround of this using something called
lazy rendering
ie. we only render the components which are just in the viewport (7-10) and reuse these components on scrolling with different datas. This may seem mayhem at first but there is a fantastic implementation inPolymerElements
<iron-list>
. Unfortunately something like that is not available in the angular right now. Own implementation may take time and can be buggy.
- Now there is workaround of this using something called
Basic pagination with buttons
-
Pros :
-
Simpler to reduce the scroll jank as at max only 20-30 components will be in viewport.
-
Easier to control the page navigation.
-
-
Cons :
-
Tougher to implement and maintain the state.
-
As now we have to think in terms of pages instead of all the results.
-
These pages will be even tougher to implement once we include filtering in the scenario, as now we have to calculate the filter across all the results and then we can't again split them up in pages.
-
Consider the situation, we have 3 pages with each containing 30 results (with only 10 results containing videos), now when we filter with videos we have nothing to show on the page 2 and 3 and they will be blank (not good situation to handle). Google has entirely different results page to show on the filtering, ie Google Images Google Videos Google News. Which is now the case in our situation as we have to filter only the current results.
-
Also the number of results coming from the API is not fixed, ie first page contains 20 results, and then when next page is clicked there are no results, and when again next page click we may receive 10 more results, which means (first page -> 20 responses, second page -> No result, third page -> 10 responses). Again not a good situation to handle.
-
@mariobehling your views on this. All inputs are required.
from loklak_search.
@hemantjadon Thanks for this sum up from your side. Lazy rendering sounds like a good thing then. Please go ahead and implement it. Cheers.
from loklak_search.
@mariobehling Is the current implementation using Show More
button good?
Also please tell what to do if the there are no results come via the api.
Which happens many time, sometimes the results come up clicking Show More
5-10 times.
from loklak_search.
Related Issues (20)
- Shift Profile section above Top Twitterers and Top hashtags HOT 1
- Add Contact Us in the grid menu HOT 5
- Improve the UI of loklak.org/settings HOT 7
- Adding Badgeyay link to FOSSASIA Projects Menu HOT 2
- Redesigining Loklak Search Settings HOT 2
- Text overlaps in sidebar for some searches. HOT 7
- Updating the badgeyay icon.
- Security vulnerabilities in some dependencies HOT 3
- Update Issue Template #930
- Implementing Customization Similar to Susper.com HOT 5
- Adding Total Amount of Search results and time taken similar to Google Search HOT 5
- Contact Form Not wokring HOT 15
- Improving Terms and Privacy page UI HOT 2
- Contact form validation has discrepancies
- Security vulnerabilities: cryptiles & timespan HOT 1
- Add tests for media-wall component HOT 1
- Security vulnerability in Webpack-dev-server HOT 1
- Add newer projects to dropdown and minor UI fixes HOT 1
- Text instead of link in settings menu HOT 3
- Failed at the [email protected] postinstall script
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from loklak_search.