Page MenuHomePhabricator

Feature Request: full text search of repositories
Closed, ResolvedPublic


Just wanted to get a feel for what is involved in adding the ability to perform full text searches of repositories.

There does appear to be some classes in place for elastic search integration, so I guess that is a potentially viable (and powerful) solution?
The more basic approach would be to use 'hg grep' (or equivalent), which would most likely be slower and more limited but probably easier to implement.


Event Timeline

kbrownlees raised the priority of this task from to Needs Triage.
kbrownlees updated the task description. (Show Details)
kbrownlees added a project: Diffusion.
kbrownlees added a subscriber: kbrownlees.

This is supported in Git (it just uses git grep). It should be straightforward to extend the implementation to use hg grep for Mercurial. In theory, I suppose we could use plain old grep in SVN, maybe with some massaging to skip .svn directories.

{T2520} (approximately) discusses a more sophisticated solution, where we'd actually build some kind of in-memory index and be able to serve requests more correctly and/or more quickly than via grep. This is probably a long way away, since none of the infrastructure we ship with is really practical for large code bases (ElasticSearch might be, but I don't have much experience with that).

Actually, this already works for Mercurial too. Click "Show Search" on any browse view:

Screen_Shot_2013-11-07_at_8.16.33_AM.png (1×1 px, 137 KB)

Maybe we should put that panel on the repositroy home page, too, although it's pretty busy already.

(I assume you don't need an SVN version?)

kbrownlees claimed this task.

Awesome, turns out I need to look harder for things!

We do use SVN but I don't think anyone who uses it really cares for this feature.

Thank you again

No problem, let us know if anything else comes up.