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

Code search exact makes not exact search 1.23.5 #33798

Closed
gomanuke opened this issue Mar 5, 2025 · 15 comments · Fixed by #33992
Closed

Code search exact makes not exact search 1.23.5 #33798

gomanuke opened this issue Mar 5, 2025 · 15 comments · Fixed by #33992
Labels
issue/needs-feedback For bugs, we need more details. For features, the feature must be described in more detail type/bug
Milestone

Comments

@gomanuke
Copy link

gomanuke commented Mar 5, 2025

Description

Hi, guys. I'm about #33713 again.
1.23.5 is almost perfect in sense of exact searching!
But here You are the simplest file that's searched by pattern 'GetPrev' in exact search.

Test.txt

Should I reindex or make something to correct this?

Gitea Version

1.23.5

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Screenshots

No response

Git Version

No response

Operating System

Debian 12

How are you running Gitea?

Was get binary and installed strictly by GiTea documentation.

Database

MySQL/MariaDB

@lunny
Copy link
Member

lunny commented Mar 5, 2025

I don't think you need to reindex since #33713 haven't change the index structure.

@lunny lunny added this to the 1.23.6 milestone Mar 5, 2025
@wxiaoguang
Copy link
Contributor

Should I reindex or make something to correct this?

I guess no. There are some unfixable problems in 1.23. A (hopefully) fix is done in main branch (will be 1.24) : Improve issue & code search #33860

If you are interested, you could try to use the nightly build to see whether the new code search works better:

@wxiaoguang wxiaoguang added the issue/needs-feedback For bugs, we need more details. For features, the feature must be described in more detail label Mar 23, 2025
@wxiaoguang wxiaoguang removed this from the 1.23.6 milestone Mar 23, 2025
@gomanuke
Copy link
Author

gomanuke commented Mar 24, 2025

If you are interested, you could try to use the nightly build to see whether the new code search works better:

Would You clarify where I can get a ready nightly binary to test it? Sorry, I don't have competency to compile it.

@wxiaoguang
Copy link
Contributor

If you are interested, you could try to use the nightly build to see whether the new code search works better:

Would You clarify where I can get a ready nightly binary to test it? Sorry, I don't have competency to compile it.

See the links in #33798 (comment)

@gomanuke
Copy link
Author

gomanuke commented Mar 24, 2025

Appreciate for Your efforts, guys.
"Exact" approach definitely differs from "Words" one.

Test.txt

But still returns file (attached) with not exact search 'GetPrev'.

Gitea version 1.24.0+dev-479-g25b6f38865 built with GNU Make 4.3, go1.24.1 : bindata, sqlite, sqlite_unlock_notify

@wxiaoguang
Copy link
Contributor

OK, I think I overall could understand the problem now.

The search result is provided by bleve's tokenizer, so GetPrev and get_prev are all treated as 2 tokens: get and prev.

Image

Image

That's the incorrect change from #22829, let's revert it.

After the fix:

Image

@gomanuke
Copy link
Author

Ready to test it! Where binary is? 8)

@wxiaoguang
Copy link
Contributor

No binary yet, need to wait for 2 approvals

@lunny lunny added this to the 1.23.6 milestone Mar 24, 2025
GiteaBot added a commit to GiteaBot/gitea that referenced this issue Mar 24, 2025
lunny pushed a commit that referenced this issue Mar 24, 2025
Backport #33992 by @wxiaoguang

Fix #33798

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
@wxiaoguang
Copy link
Contributor

Now the night binaries are ready.

@gomanuke
Copy link
Author

Well I've got after upgrading to 1 23 6:

2025/03/25 09:09:19 ...ations/migrations.go:481:Migrate() [F] Migration Error: Your database (migration version: 318) is for a newer Gitea, you can not use the newer dat
abase for this old Gitea release (312).
Gitea will exit to keep your database safe and unchanged. Please use the correct Gitea release, do not change the migration version manually (incorrect manual operation
may lose data).

@gomanuke
Copy link
Author

gomanuke commented Mar 25, 2025

But previous nightly release starts successfully. It seems Your nightly build has a newer DB version than 1 23 6 release.

@lunny
Copy link
Member

lunny commented Mar 25, 2025

Uh-oh! Your Gitea instance is now on the main branch.

@gomanuke
Copy link
Author

Uh-oh! Your Gitea instance is now on the main branch.

Would You advice what should I do to move on releases? I mean 1 23 6 and further...

@lunny
Copy link
Member

lunny commented Mar 25, 2025

I will recommend you follow main branch until 1.24 is released and then follow 1.24. Manually downgrade is dangerous for non developer of Gitea.

@wxiaoguang
Copy link
Contributor

wxiaoguang commented Mar 25, 2025

https://docs.gitea.com/installation/upgrade-from-gitea

  • Now (2025-03-25) main-nightly is the unreleased 1.24
  • 1.23-nightly is for the 1.23.x (the latest stable release)

It's generally safe to use main-nightly (1.24) because many maintainers also use that edge version, any bug could be fixed in first time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
issue/needs-feedback For bugs, we need more details. For features, the feature must be described in more detail type/bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants