Code Monkey home page Code Monkey logo

Comments (14)

cocoonkid avatar cocoonkid commented on September 26, 2024 2

much love @scambier

from obsidian-omnisearch.

scambier avatar scambier commented on September 26, 2024 1

Omnisearch does a token-based search, and the url https://foo.bar/baz is actually read as https foo bar baz. The highlighting reflects that.

Though I understand how it can be unexpected with this kind of usecase and will look to rework the highlight and "go to line"

(Might be related to #301 too)

from obsidian-omnisearch.

scambier avatar scambier commented on September 26, 2024 1

I've published a version 1.22.0-beta.1 last week that should improve the general highlighting.

from obsidian-omnisearch.

cocoonkid avatar cocoonkid commented on September 26, 2024

Yes, I also have the same issue like #301

Maybe optionally a list of regex that will always be searched as full string.?
So I could declared urls to always search not-token-based.

from obsidian-omnisearch.

scambier avatar scambier commented on September 26, 2024

This is now deployed in the 1.19.0-beta.1 version (if you use BRAT). I'll probably push it on the main branch within 2 weeks. You'll also need to clear your Omnisearch cache for a full reindex.

from obsidian-omnisearch.

cocoonkid avatar cocoonkid commented on September 26, 2024

@scambier Could it be that Obsidian changed smth? I cannot query for urls again...just noticed that right now.
I cleaed the cache and restarted and made sure I have all updates in.

from obsidian-omnisearch.

scambier avatar scambier commented on September 26, 2024

Nope, no change since the update that included this feature 🤔

image

from obsidian-omnisearch.

cocoonkid avatar cocoonkid commented on September 26, 2024

Okay, it seems to work most of the time but still not everytime.

see this example. What could the reason be? Would there be a way to add more weight to full matches? especially with urls?

image

from obsidian-omnisearch.

cocoonkid avatar cocoonkid commented on September 26, 2024

Still having these issues. Thanks for your time :-)

from obsidian-omnisearch.

KraXen72 avatar KraXen72 commented on September 26, 2024

hi, i also have this issue:
query: "normie.cc"
part of markdown file with match:

# contents
- main homepage with social icons + something custom
	- https://kasper.space cool starry animated bg
	- https://thedise.me nice background, social icons
	- https://www.normie.cc cool greeting font
	- [tinyclouds](https://tinyclouds.org) cool social icons

omnisearch:
image
image
image

the highlights works somewhat properly when using in-file search though?
image
image

from obsidian-omnisearch.

cocoonkid avatar cocoonkid commented on September 26, 2024

I think the solution would be an option for an ignorelist.

Whenever I remove the https scheme for example it works.
I personally would just add https://github.com to the ignorelist so the search always only focusses on the remainder of the path.

example:

https://github.com/scambier/obsidian-omnisearch --> only searches for scambier/obsidian-omnisearch

@scambier Please please stop our suffering :-)

from obsidian-omnisearch.

KraXen72 avatar KraXen72 commented on September 26, 2024

i think a better solution might be rewriting the highlighting to support highlighting several matched tokens

from obsidian-omnisearch.

cocoonkid avatar cocoonkid commented on September 26, 2024

Just tried it out. Unfortunately no improvement so far. I deleted the cache and restarted + reindexed as well.
image

example :

image

image

Thank you for your continued pursuit of this issues. Really highly appreciated.

Maybe if it could just ignore a list of schemes?

from obsidian-omnisearch.

KraXen72 avatar KraXen72 commented on September 26, 2024

i from how omnisearch (and under the hood, minisearch) works, the whole query gets split into terms - many files have some of the terms from that url, but it happens so that the file with the full url has most terms, so it's at the top. the problem is, not all the terms are necessarily found one after another in the file, leading to the highlighting you see.

i think it could be worth exploring detecting urls in the search query, and adding custom highlighting logic if the query contains a url, to try to highlight most of it without interruptions.
it also could be useful to see if minisearch has some options which are relevant to this problem. (something like a locality or continuity bonus)

from obsidian-omnisearch.

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.