-
Notifications
You must be signed in to change notification settings - Fork 167
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
Advanced search #423
Comments
The reason is just complexity: since we don't want the user to have to write "foo|bar" for a disjunctive search term, we can't just treat the user-inputted search string as a regex. If we want to allow more advanced searches, we would therefore have to perform more varied transformations from the user-inputted string to a valid regex. There may be libraries that do this, i.e. construct regexes out of intuitively formatted user-inputted search strings: if anyone knows any and wants to try to hook it into An easier way of adding some advanced search functionality might be to have a "Regular expression" checkbox under/next to the search bar, and treat the user-inputted search string as a regex if and only if that's set to true. Again, happy to accept and help out with a PR for this! |
If I am searching a needle in a haystack, it does not help me to get more hay in response to me providing more detailed search information. If I enter Would you be interessted in getting a patch to have this fixed? |
@oetiker as it stands, you can search for I took it @sirtoobii was about the possibility of more advanced pattern matching, which would require implementing one of the two solutions I indicated. |
Just realized I maybe got @oetiker wrong and the suggestion is to return only pages (not lines) that contain both We're certainly interested in PRs that improve the existing search functionality, but at least these three questions need to be take into consideration:
|
How about behaving somewhat like google does ? |
Currently search terms are split by space, all "regex"-sequences are escaped by
Regexp.escape()
and then concatenated using|
which prevents any complex searches:gollum-lib/lib/gollum-lib/wiki.rb
Lines 500 to 501 in 3f8955a
Is there any particular reason to allow only
OR
"advanced" searches?Gollum Version: 5.3.0 on Ubuntu 20.04
The text was updated successfully, but these errors were encountered: