fwextensions / QuicKey

Jump between recent tabs in Chrome via keyboard shortcuts or a most recently used (MRU) menu.
https://fwextensions.github.io/QuicKey
214 stars 21 forks source link

Search For URL and Title Did Not Work #48

Open aakash-shah opened 3 years ago

aakash-shah commented 3 years ago

Hello! I am comparing Quick Tabs and I noticed that a search today did not work in QuicKey as I expected it to. I wanted to ask if this is a bug, if I need to adjust my search, or if this scenario is not supported:

I have multiple pages on Yelp.com open for different Indian restaurants in 1 of my many open windows. I performed the search "yelp India" in the search, but none of the results I was looking for arose. I performed the same search in Quick Tabs and it worked and showed me the correct results of open windows.

Does QuicKey support searching for both the URL "yelp" (.com) and a title "India"? If so, how can I perform this search?

I am using QuicKey 1.5.1 in MS Chromium Edge.

Thanks!

fwextensions commented 3 years ago

Thanks for the detailed feedback. I think this is related to issue #11. If you don't type a space, and just search on yelpindia do you get better results?

When the option to have the spacebar insert a space is on, the space character becomes part of the query, so the algorithm expects to match a literal space somewhere between the words. If the string has something else before it, like q=india in the URL, then it won't match.

The other thing is that since it's just one query being matched, the words still have to be in the same order. They're not matched independently, which I think is what users probably expect if they insert a space. It's a reasonable request, but it would require a fair amount of reworking of the scoring mechanism.

It's also not entirely clear how it should work. Should partial matches across words still be allowed? If you were searching yelp lp for a record store, it would match yellow potato, even though a single p is matched in both tokens. Should that be allowed? Maybe if there's a space in the query, all the tokens are expected to be exact substring matches, though that's also limiting, since then you wouldn't be able to type fbi tip to match a title like F.B.I. Tip Line.

aakash-shah commented 3 years ago

Hello! Searching for "yelpind", "yelpindi" and "yelpindia" came up with more results, but were also not what I was expecting. With these queries, I also got Yelp pages I have open that contained the following words (I've bolded the characters matched in the search):

"Diamond" "Hacienda" "fina" "https://www.yelp.com/collection/0p-IlhJadi_..." ("di" was matched here, and I snipped the ending and replaced it with ellipses).

The other thing is that since it's just one query being matched, the words still have to be in the same order. They're not matched independently, which I think is what users probably expect if they insert a space. It's a reasonable request, but it would require a fair amount of reworking of the scoring mechanism.

Good to know about the order! I would probably not have realized/remembered that, although in my case the words in my query happened to be in the same order.

It's also not entirely clear how it should work. Should partial matches across words still be allowed? If you were searching yelp lp for a record store, it would match yellow potato, even though a single p is matched in both tokens. Should that be allowed?

For me at least, "yelp lp" should not return "yellow potato". On the other hand, if the query was "yelp l p", then I could understand returning all results with the letters "l" or "p" in them.

Maybe if there's a space in the query, all the tokens are expected to be exact substring matches, though that's also limiting, since then you wouldn't be able to type fbi tip to match a title like F.B.I. Tip Line.

True. I can only speak for myself, but this would be acceptable for me and is what I would expect to happen. But having an option for a single or multiple character wildcard would perhaps solve that. I would like to think that people looking for text in their own browser windows would hopefully know to type in the exact characters they are looking for like "F.B.I. Tip Line". Or perhaps some way to specify wildcards without being seen as literals. Just a thought, but perhaps prefixing something like "/l" and then everything after that is searched per letter (vs per word). Or even better, although this may require more changes, is that the search box has a down arrow to expand the search to reveal a search builder GUI where users could ask QuicKey to search for individual letters in the phrase too (the current default) or some other customization they need easily.

Thanks!

fwextensions commented 3 years ago

Thanks for the response.

With these queries, I also got Yelp pages I have open that contained the following words

That's expected, but hopefully results where the query matches letters at the beginnings of words are sorted higher.

I can only speak for myself, but this would be acceptable for me and is what I would expect to happen. ... I would like to think that people looking for text in their own browser windows would hopefully know to type in the exact characters they are looking for like "F.B.I. Tip Line".

The drawback is that if you type fbi, the F.B.I. tab will show up, but as soon as you type fbi t, it would disappear, since the space would cause the matching to switch an exact substring. So that's potentially confusing.

Anyway, given these questions, and that most people seem to use QuicKey mostly to select recent tabs from the list rather than search for them, I haven't really tried tackling multiple token scoring yet.

If you're interested in comparing the scoring algorithm used in QuicKey to other libraries, I have a demo that shows a side-by-side comparison.