go-gitea / gitea

Git with a cup of tea! Painless self-hosted all-in-one software development service, including Git hosting, code review, team collaboration, package registry and CI/CD
https://gitea.com
MIT License
44.78k stars 5.47k forks source link

Code Search: Search for Substring #16158

Open marbetschar opened 3 years ago

marbetschar commented 3 years ago

Description

It would be great to be able to search for substrings in the Code Search. For example, if I search for "dat" the search returns results containing "Update", "dateTime", ...

lunny commented 3 years ago

It may result in bigger index size which may spend serval times disk usage.

marbetschar commented 3 years ago

I'm aware and in my case thats fine. However, I'm not able to figure out if this feature is available - and if so, how to enable it?

lunny commented 3 years ago

It's not implemented I think.

zeripath commented 3 years ago

Would likely need to change the tokenizer here:

https://github.com/go-gitea/gitea/blob/f7cd394680f885061144d236abc3c25f30be3147/modules/indexer/code/bleve.go#L138

to letter.Name instead.


however you may find that applying the stemmer token filter and or camelcase token filters help more.

marbetschar commented 3 years ago

Any chance this will be implemented in a future release?

jowilkes commented 10 months ago

I, too am looking for this feature. (database: PostgreSQL, Indexer: any.)