Coder Social home page Coder Social logo

Comments (11)

krixano avatar krixano commented on August 30, 2024 1

You can make the search engine appear like it's going faster by, on a first query, limiting to the amount you want to show on the first page, then immediately doing another query for the next page - still with a limit. Then, when they click the next page, immediately show those results and query for the next page.

One thing you should do with this though, is to make sure you do your sorting in sql rather than javascript that way the sorting happens for everything, before the limiting, rather than per page.

from horizon.

blurHY avatar blurHY commented on August 30, 2024 1

@krixano
Merge pages that is the same zite.I think it could be done with group_concat,but we need to find a separator.If it can return a array for each item,the better.

from horizon.

blurHY avatar blurHY commented on August 30, 2024

I just do some complex things with javascript after sql query,but i won't use js to sort or filter 5 million data 😂
https://github.com/blurHY/Horizon/projects/1#card-13092259

from horizon.

krixano avatar krixano commented on August 30, 2024

Btw, in the code for Important Zites (and KxoNetwork), I have code that constructs an sql query to query for zites based on relevance by seeing how many words in the query match whatever is in the database, as well as putting priority over certain fields. If you open the console on Important Zites or KxoNetwork while searching, you can see this.

It could perhaps be useful to you, although, I think your search query could probably be simpler than mine since you are searching from selected keywords, rather than, with mine, I'm searching through all text.

I'll link you to the exact code when I find the time, but I did post some ZeroMe posts about this a while ago, so you may be able to find it on my ZeroMe profile.

from horizon.

blurHY avatar blurHY commented on August 30, 2024

I used to write some title rank * 2 too.
And I'm going to implement PageRank algorithm for ranking.The site descriptions text data has been already published.So there is a lot of things need to be calculated for the final score.
Uh,i don't know it should be title rank * 2 or title rank * 1.5 or something else.

from horizon.

blurHY avatar blurHY commented on August 30, 2024

Search 'b'
Takes 4.619s returns 73918 rows
Takes 3.743s with limit 70000,3000
Takes 3.312s with limit 10,3000
Maybe it will not be much quicker to query.

from horizon.

krixano avatar krixano commented on August 30, 2024

Did you try limiting to 10 or 20 or so (that's what I was meaning above, since only 10-20 will be shown on a page at a time)? Also, a half a second minimum is definitely significant imo, especially for search.

from horizon.

blurHY avatar blurHY commented on August 30, 2024

It filter the database then order the result.If we just limit it,the result won't be the best match.Or we still need to scan the whole database

from horizon.

krixano avatar krixano commented on August 30, 2024

If you do sorting/ordering in SQL, then that happens before limiting.

from horizon.

blurHY avatar blurHY commented on August 30, 2024

So it's hard to improve.But if the new plugin system has been implemented and zeronet has moved to py3,it would be possible.

from horizon.

krixano avatar krixano commented on August 30, 2024

What things are you doing in js that you can't do in SQL currently?

from horizon.

Related Issues (18)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.