Giter VIP home page Giter VIP logo

Comments (4)

CheshireSwift avatar CheshireSwift commented on August 21, 2024

When you say you're not sure whether sql.js supports "this" - relevancy? Sorting?

from guildwarsitembrowser.

MFAshby avatar MFAshby commented on August 21, 2024

Sqlite3 proper supports adding your own functions to rank search results, so you can display the most relevant ones first. See https://www.sqlite.org/fts3.html#matchinfo.

However, Sql.js currently provides no hook to register your own functions. See https://github.com/kripken/sql.js/issues/60.

If one were to implement registering your own functions in sql.js, those people would surely be happy to see you create a pull request for it.

from guildwarsitembrowser.

MFAshby avatar MFAshby commented on August 21, 2024

I've done custom functions for SQL.js. Now need to implement rank function. See https://www.sqlite.org/fts3.html#appendix_a for inspiration.

from guildwarsitembrowser.

CheshireSwift avatar CheshireSwift commented on August 21, 2024

Nicely done. I was thinking about what we can apply as a custom function.

If we only search on full words and we require each of the words to appear in the name for an item to be included then I think we have a super simple metric in the form of total string length (or even better, total word count).

Each result will have at least your query in and things that have more than that are less likely to be what you were after.

I'm going to implement that as a baseline. From there, I think it's our best bet would be to have a few keywords that bump things up the list (e.g. "dye") and/or weight things by their total trade volume (number of buy/sell orders). The latter would require hitting the API for up-to-date info, though doing that would also allow us to show current prices in the search results.

from guildwarsitembrowser.

Related Issues (20)

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.