Comments (5)
How about behaving somewhat like google does ?
from gollum-lib.
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 gollum-lib
in the method @sirtoobii refers to, we'd be happy to help out with a PR for that!
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!
from gollum-lib.
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 red fish
I would expect to get documents with the words red
and fish
in them. Instead I get documents with either ... is there use case for that ?
Would you be interessted in getting a patch to have this fixed?
from gollum-lib.
@oetiker as it stands, you can search for "red fish"
and get lines that match both or red fish
and get lines that match either. I believe this is fairly standard search practice, though it would certainly be nice to have a little help function for the search bar that makes this explicit.
I took it @sirtoobii was about the possibility of more advanced pattern matching, which would require implementing one of the two solutions I indicated.
from gollum-lib.
Just realized I maybe got @oetiker wrong and the suggestion is to return only pages (not lines) that contain both red
and fish
. This would certainly be a nice feature, but I would hesitate to say that it makes sense as a default: if I search for two IP addresses, say, I might still be interested in pages that contain only one of the two. Or I might expect to be given pages that include lines that match both expressions.
We're certainly interested in PRs that improve the existing search functionality, but at least these three questions need to be take into consideration:
- Should the user-supplied string by default be taken as intending to be matched on a page or line (current behavior) level?
- Should
A B
by default be taken as a disjunction or as a conjunction? - What ways should the user be given to override these defaults, and/or to supply regular expressions themselves?
from gollum-lib.
Related Issues (20)
- sanitize lib needs update (CVE-2018-3740) HOT 4
- Recent versions of sanitize break jruby HOT 1
- Depends on an old version of sanitize HOT 14
- Make file search case insensitive HOT 1
- 5.x: TOC doesn't show up in subpages HOT 2
- Set commit date on committing changes HOT 12
- Gollum should register ".adoc" as a valid file extension for AsciiDoc
- Series macro can't be used in subpages
- pandoc-citeproc no longer supported HOT 2
- Improve Navigation or TOC.
- Make dependency on twitter optional HOT 1
- markups @master still referring to python2 for rst support HOT 2
- Possible to append to default filter chain? HOT 5
- More efficient sanitization
- Customization (like sorting and filtering) of the navigation or TOC macros? HOT 1
- Default CommonMarker options?
- Add page categorization (or concept tagging) feature HOT 8
- Macro filter turned boolean arguments into string HOT 2
- Rethink logic for Macro sanitization HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gollum-lib.