Giter VIP home page Giter VIP logo

Comments (3)

fwextensions avatar fwextensions commented on August 30, 2024 1

What's currently done today in the scoreKey field if there are multiple matches with the same score?

The first key in the keys array wins, so maybe the same could be done with an array of strings.

from quick-score.

fwextensions avatar fwextensions commented on August 30, 2024

Thanks for the feedback! I was actually just thinking about matching against an array of strings, from a discussion in #11.

Would you expect the score for an array of strings to be highest score for any of the strings? The average?

Another complexity is returning which string matched. Not sure if that should be an index into the array or the actual string containing the match. It's also tricky if multiple strings have the same score.

"work added" would match the first result with a high score, when it should probably have a lower score if each label was considered separately.

Matching the "work added" query against the individual strings would actually return 0 for each one, since neither contains all of those characters.

from quick-score.

vayyala avatar vayyala commented on August 30, 2024

Absolutely! Thanks for working on this library :)

Work you expect the score for an array of strings to be highest score for any of the strings? The average?

I think what would be ideal would be if the score matched the highest of the strings. We only use the score to sort the options, and in the case that there's a match to one of the elements in the array, we'd want to show it near the top.

Another complexity is returning which string matched. Not sure if that should be an index into the array or the actual string containing the match.

What fuse does is to return another field in the search result that corresponds to the full matched value. I guess the analogous field here would be a scoreValue field to correspond to the current scoreKey. Index would also work great for us, but I suspect the scoreValue might be more elegant for general use cases.

It's also tricky if multiple strings have the same score.

Ah yes this might be tricky. In our use case, if multiple strings have the same score, having only one of them would be more than sufficient. What's currently done today in the scoreKey field if there are multiple matches with the same score?

from quick-score.

Related Issues (17)

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.