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

Improve search result highlight and positioning #8274

Closed
3 tasks done
michaelbeijer opened this issue May 16, 2023 · 7 comments
Closed
3 tasks done

Improve search result highlight and positioning #8274

michaelbeijer opened this issue May 16, 2023 · 7 comments
Assignees
Milestone

Comments

@michaelbeijer
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Can the issue be reproduced with the default theme (daylight/midnight)?

  • I was able to reproduce the issue with the default theme

Could the issue be due to extensions?

  • I've ruled out the possibility that the extension is causing the problem.

Describe the problem

I have only just started using SiYuan, but have run into two problems with search.

1. Ctrl+P isn't finding anything. Well, it does sometimes, but mostly it is not finding longer phrases. Or even shorter prases.

For example, if I search (using Ctrl+P) for "Method of agitation and agitator for vats and the final products obtained", which I know is in a document with a table of patent names, it highlights a few random words near the top of the table. If I write the exact phrase ("Method of agitation and agitator for vats and the final products obtained") at the top of a page, and re-run the search, it finds it.

2. Ctrl+F just seems to open the same window as Ctrl+P. If I open the page with the table mentioned above, and click Ctrl+F, the same window opens up, and then try to search for "Method of agitation and agitator for vats and the final products obtained", I get the same behaviour as described above.

Expected result

I expect search to find (and highlight) exactly what I am looking for. Not random words all over the page, as is currently happening.

Screenshot or screen recording presentation

search-problem

Version environment

- Version: 2.8.7
- Operating System: Windows 11
- Browser (if used): Chrome

Log file

siyuan.log

More information

No response

@88250
Copy link
Member

88250 commented May 16, 2023

Hello, the default search method is Keyword, which uses spaces to separate search keywords and connects them with "AND" logic.

image

If you want to fully match the search keyword, you can change the search method to Query Syntax, and use double quotes to wrap the input, such as "foo bar".

@88250 88250 closed this as completed May 16, 2023
@michaelbeijer
Copy link
Author

Thanks for the info! However, changing it from Keyword to Query Syntax, and adding quotes to the search phrase hasn't solved the problem. Strangely, the results are exactly the same as before.

@michaelbeijer
Copy link
Author

I made a quick video to show you what I mean: https://app.screencast.com/1PC4mbnCG2Mdr

@88250 88250 changed the title Search not working for me Improve search result positioning May 16, 2023
@88250
Copy link
Member

88250 commented May 16, 2023

We know what the problem is from your demo, but we need some time to think about how to improve it, thank you very much.

@88250 88250 reopened this May 16, 2023
@88250 88250 self-assigned this May 16, 2023
@michaelbeijer
Copy link
Author

Cool, thanks!

@michaelbeijer
Copy link
Author

By the way, is there a keyboard shortcut to jump to the next match in the document? That would also be very useful in scenarios where there are multiple similar hits in a document, as otherwise you need to do a lot of scrolling. Spacebar would be a good one!

@88250
Copy link
Member

88250 commented May 16, 2023

There is currently no shortcut key to switch, but you can switch with a mouse click.

image

@88250 88250 modified the milestones: 2.8.9, 2.8.10 May 16, 2023
@88250 88250 changed the title Improve search result positioning Improve search result highlight and positioning May 19, 2023
@88250 88250 modified the milestones: 2.8.10, 2.8.9 May 19, 2023
Vanessa219 added a commit that referenced this issue May 19, 2023
Vanessa219 added a commit that referenced this issue May 19, 2023
@88250 88250 closed this as completed May 19, 2023
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

3 participants