-
Notifications
You must be signed in to change notification settings - Fork 5
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
Search #41
Comments
Can you send me a link to info on the Gollum search? I haven't see that before. |
Oh sure - it's dead simple - just calls out to git grep. Lines 432-450 here: https://github.com/github/gollum/blob/master/lib/gollum/wiki.rb And then in front end: https://github.com/github/gollum/blob/master/lib/gollum/frontend/app.rb there's a /search route. |
Search functionality would be a sweet addition, if anyone wants to submit a patch. |
Is there any progress on this feature? |
As Atalanta pointed out we get search for free out of what is now gollum-lib. So it's pretty trivial to get this started on the backend, it just needs a view and I haven't quite mastered how smeagol is rendering. Outside of the rendering issue, the method is going to look very close to this (most of which is taken from here): get '/search' do
@query = params[:q]
wiki = Smeagol::Wiki.new(repository.path, :base_path => mount_path)
# Sort wiki search results by count (desc) and then by name (asc)
@results = wiki.search(@query).sort{ |a, b| (a[:count] <=> b[:count]).nonzero? || b[:name] <=> a[:name] }.reverse
@name = @query
mustache :search
end |
Any chance to have this feature one day ? |
I 'd like also to get the search feature available. |
What do you think would be involved in adding a search capability to Smeagol? One of the great advantages of Gollum is the super-fast git-backed search.
The text was updated successfully, but these errors were encountered: