-
-
Notifications
You must be signed in to change notification settings - Fork 22
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
Is it possible to add a fuzzy search function? #49
Comments
Currently, I send the URL without the hash part to logseq to make this recall function. If you want to extend this function, I suggest just sending one request to logseq and recalling everything you need. Otherwise, logseq needs to process a lot of requests in a short time. And, there are 2 parts of code related to the recall function. One is for popup searching: logseq-copilot/src/pages/popup/Popup.tsx Lines 44 to 59 in 32e0a04
Another is for badge count number: logseq-copilot/src/pages/background/index.ts Lines 103 to 109 in 32e0a04
|
And before putting effort into the development work. I want to know the rules or patterns. what will be in the search result, and what should be excluded. Could you give an example of fuzzy searching? |
Hi EINDEX, thank you for your reply! Since I primarily use chatGPT for programming, I will do my best to describe it. Here are two sample websites: My thought will be no matter which page of the site we click, the plugin can always detect my notes under the website. Then we don't have to read the website again. I gave my question to ChatGPT this is what I got, I have not idea how to test it yet 😂 useEffect(() => {
if (isLoading) return;
new Promise(async () => {
console.log('loading');
let queryOptions = { active: true, lastFocusedWindow: true };
let [tab] = await Browser.tabs.query(queryOptions);
setIsLoading(true);
if (!tab.url) return;
const url = removeUrlHash(tab.url);
// Format URL to match wildcard
const formattedUrl = url.replace(/\/.+/, ''); // Matching and removing everything after the last slash using a regular expression
// Format URL to match regular expression
const regexFormat = `^${formattedUrl.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&')}`; // Escaping special characters
const result = await client.blockSearch(regexFormat);
if (result.status !== 200) return;
setLogseqSearchResult(result.response!);
mountOpenPageMethod();
});
}); |
Oh, Maybe I got your idea, you want to have all the notes related to one website. For example: When I am on the Is that right? |
Yes!! You understand it correctly. |
released in |
That was Awesome!! Thanks a lot!!!!!🥳 |
Is your feature request related to a problem? Please describe.
I found this plugin to be very helpful when I started collecting data from various websites. However, I encountered a problem when trying to take notes for a specific website. The plugin only matches the note with the exact URL, whereas I would like it to detect any notes I wrote on a certain URL.
Describe the solution you'd like
My suggestion would be to add a fuzzy search option that can be turned on whenever needed.
Describe alternatives you've considered
If it's not the priority, do you mind telling me which file can change the search mode? I can try to see if I can add this function.
The text was updated successfully, but these errors were encountered: