Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ordering Search Results #5684

Open
sleepyfurious opened this issue Mar 30, 2023 · 0 comments
Open

Ordering Search Results #5684

sleepyfurious opened this issue Mar 30, 2023 · 0 comments

Comments

@sleepyfurious
Copy link

sleepyfurious commented Mar 30, 2023

Hi,

Currently, the global search's results don't seem to be in any particular order. This makes it hard in a use case when the user doesn't initially know exactly what to look for; for example, searching for #tags in various sections of many files in the file tree created cumulatively over the years. I've reviewed a few past issues, and I have a proposal, which I describe below.

Thanks,

The proposal

The proposal: list the files in the result with the same order configured in the file tree.

This gives the user the experience of literally:

  • filtering the files in the tree for those that contain the matched content. (This is an improvement).
  • supplying the user with a list of matched text in each file. (This is already offered in Typora).

Here are the supporting reasons:

  • It can be implemented easily

    Unlike Prioritize search results #2484 and Search score sort and improvements #2192, we don't have to "prioritize" or "score" the search result. We can just fit the file traversal used in the file tree to the global search's system. As the global search's system already lists the results by file, ideally, the system just filters the files' content with the same code as-is, and the implementation required is to supply the system with the list of files ordered with the sort function of the file tree.

  • This is a seamless addition to Typora

    Many users who develop a rich set of markdown files with Typora's file management are already familiar with and depend on the order of files in the file tree to help them navigate their files. They likely tend to reason about their files according to the sorting options (accompanied by their characteristics) offered in Typora. By presenting the files in global search's results in the same order as the file tree, this is seamless to the user. And with the reason of "can be implemented easily" given in the above bullet, I hope this is seamless for the dev team too. :)

The example

This is an example of the expected experience: A book writer names their files according to an outline of the book and sort the file tree by Name, say:

The file tree:

  • 1. Chap1 - Housekeeping
  • 1.1 chap1 section1
  • 2. Chap2 - Grocery Shopping
  • 2.1 chap2 section1
  • 2.1 chap2 section2
  • A. Appendix

When he is interested in reviewing his book about a pen, he supplies the global search with keyword "pen"—of course, any text with word "pencil" is also listed in the search. He can keep track of "what" to focus on with his familiarity with his book outline. Here is an example search result:

The global search's result:

  • 1.1 chap1 section1
    ...pen.................
    .........pencil.......

  • 2. Chap2 - Glocery Shopping
    ..........pen..........
    ........pencil.........

  • 2.1 chap2 section2
    ....pen................

  • 3. Appendix
    ..........pen..........

If he doesn't currently care about grocery shopping, he can skip the files whose names begin with "2.", naturally. This can be very helpful when the list is "larger than the display".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants