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

Repo indexer not searching some method names #5694

Closed
2 of 7 tasks
mcdamo opened this issue Jan 10, 2019 · 5 comments
Closed
2 of 7 tasks

Repo indexer not searching some method names #5694

mcdamo opened this issue Jan 10, 2019 · 5 comments
Labels
issue/confirmed Issue has been reviewed and confirmed to be present or accepted to be implemented type/enhancement An improvement of existing functionality

Comments

@mcdamo
Copy link

mcdamo commented Jan 10, 2019

  • Gitea version (or commit ref): 1.6.3
  • Git version:
  • Operating system: FreeBSD
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
    • Not relevant (indexer not enabled)
  • Log gist:

Description

I have code like $e->getMessage() but the indexer cannot search 'getMessage'.
To find this code I must search '*Message', but obviously that example brings up many unwanted results.

Code like $this->method() can be searched with 'method' so perhaps the indexer is splitting the camelcase words.

@lunny lunny added the type/enhancement An improvement of existing functionality label Jan 11, 2019
@stale
Copy link

stale bot commented Mar 12, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 weeks. Thank you for your contributions.

@stale stale bot added the issue/stale label Mar 12, 2019
@mcdamo
Copy link
Author

mcdamo commented Mar 12, 2019

Possibly related #5277 (cannot search snake_case)

@stale stale bot removed the issue/stale label Mar 12, 2019
@lunny lunny added the issue/confirmed Issue has been reviewed and confirmed to be present or accepted to be implemented label Mar 13, 2019
@guillep2k
Copy link
Member

Same here. For instance, I search for "main" and I get quite a few hits, but none of them is a main() function which I'm certain exists. It's not only a camel case problem, apparently. Also, it's not necessarily an index problem, but perhaps a retrieval problem?

image

image

But:

image

One might think: it's indexing Mon and Console separately, but with other words it works half-fine:

image

Here the .h definition is correctly found, but the corresponding .c implementation is not.

@guillep2k
Copy link
Member

I made some tests, and the culprit is here, in modules/indexer/repo.go. It's explicitly calling for a camel case converter in the token_filters slice:
image
I'm sure there are cases where this is very much the desired behaviour, but it surely isn't what I was expecting. I tried removing camelcase.Name from the list and it's working for me, now.
A switch to choose the desired behaviour could be implemented as a setting in app.ini, but the previous indexes must be dropped and recreated if the setting is changed after the fact. An option to re-build the repo indexes in the Maintenance Operations section of /admin would be handy.

@mrsdizzie
Copy link
Member

Should be fixed from #7733

@go-gitea go-gitea locked and limited conversation to collaborators Nov 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
issue/confirmed Issue has been reviewed and confirmed to be present or accepted to be implemented type/enhancement An improvement of existing functionality
Projects
None yet
Development

No branches or pull requests

4 participants