GithubHelp home page GithubHelp logo

Strange search behavior about slate HOT 9 CLOSED

slatedocs avatar slatedocs commented on May 13, 2024
Strange search behavior

from slate.

Comments (9)

lord avatar lord commented on May 13, 2024

Seems to be finding it for me. The odd thing is that it also somehow is matching the "Automating mobile web apps" section as well...hmmm.

screen shot 2014-04-19 at 9 22 58 pm

from slate.

bootstraponline avatar bootstraponline commented on May 13, 2024

This is what I see on Chrome. It looks like a bug to me.

search_bug

from slate.

lord avatar lord commented on May 13, 2024

Hmm, that is the behavior I would expect, it just filters the sections down to the sections containing the search query, but the the optimal behavior...it would be nice if the view skipped down to the first search result. I'll open a separate feature request for this.

from slate.

bootstraponline avatar bootstraponline commented on May 13, 2024

Automating mobile web apps doesn't contain the string write docs so I think it should be hidden? I'm expecting only How to write docs to be displayed on the side bar.

from slate.

lord avatar lord commented on May 13, 2024

Hmm. I think Automating mobile web apps contains both the words "write" and "docs", and so the fuzzy searching is picking it up. At least, that's my guess.

from slate.

bootstraponline avatar bootstraponline commented on May 13, 2024

Yes, I think that's the bug. It's doing a search for write AND docs when the expected search is "write docs" the complete literal string. Compare the current behavior to the Google chrome built in search.

search

If I changed the search behavior to match the Google chrome search, would you accept a pull request?

from slate.

lord avatar lord commented on May 13, 2024

Hmm, I'd rather not make the search quite as blunt as the Google Chrome search...it seems that Lunr gives us a score property, what if we just sorted the sections by that, so the best-matching section appears first? That would make "how to write docs" appear at the very top, and the less-well-matching results appear farther down the page.

from slate.

bootstraponline avatar bootstraponline commented on May 13, 2024

I was just about to comment. Enforcing a minimum score resolves the issue.

2 results! all.js:3143
Object {ref: "how-to-write-docs", score: 0.4679618817634447} all.js:3145
Object {ref: "automating-mobile-web-apps", score: 0.00003974502238349404}

The unexpected matches have a very low score.

from slate.

lord avatar lord commented on May 13, 2024

Perfect! If you find a nice threshold, I would be glad to accept a pull request that sets a minimum.

from slate.

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.