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

Search #41

Open
Atalanta opened this issue Oct 15, 2011 · 7 comments
Open

Search #41

Atalanta opened this issue Oct 15, 2011 · 7 comments
Labels

Comments

@Atalanta
Copy link

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.

@benbjohnson
Copy link
Contributor

Can you send me a link to info on the Gollum search? I haven't see that before.

@Atalanta
Copy link
Author

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.

@trans
Copy link
Member

trans commented Jul 21, 2012

Search functionality would be a sweet addition, if anyone wants to submit a patch.

@jalberto
Copy link

Is there any progress on this feature?

@pearofducks
Copy link

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

@openhoat
Copy link

openhoat commented Sep 4, 2014

Any chance to have this feature one day ?

@pberto
Copy link

pberto commented Feb 20, 2015

I 'd like also to get the search feature available.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

7 participants