Add possibility to match multiple times a word with excerpt function
Add times options in excerpt
I think this is a very specific case that should not belongs to Rails, but to a gem, or to your project. But I'll ask for more feedback.
cc/ @josevalim @carlosantoniodasilva
I have to agree with @rafaelfranca, it adds a lot of complexity to the method for something that seems very application specific. Do you have a particular use case for that? Thanks!
You're maybe right. My goal was to copy the google's behaviour. For example, when I search for "test rails bla" I have this result :
Every model MyModel in Rails has a corresponding unit test case in the class ... ruby: header: Introductory article on Ruby body: bla bla bla user: joe # Article ...
I must to continue my work, to split the phrase, but I thought to do 2 pull requests.
Seems a legitimate use case but I don't think we should add more complexity to this method since this use case will not be often used.
But this can be very useful as a gem.
Anyway, thank you so much for your contribution and time. I'll leave this open from now because someone can think that this is useful and should be merged in.
Do you think I should continue my work and do another pull request in order to have a google's clone?
Lets wait form more feedback.
cc/ @jeremy @fxn
It's been 4 months, I guess nobody thinks it's useful enough to merge. Please make this a gem, @GCorbel .