-
-
Notifications
You must be signed in to change notification settings - Fork 641
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 feature #982
Comments
Oh wow, that's looking great. It reminds me of GitHub. I'd just suggest you start small, maybe break it down into multiple deliverables to simplify reviewing and also start getting value early out of this feature. Questions:
|
Yes, I took the inspiration from GitHub, Twitter, and a bit from Google too.
I think the first iteration will contain a basic parsing (i.e. being able to parse something like that However, concerning the intermediate reviews, it'll be complex. My thoughts on your questions:
And by the way, as a little preview, I made the parsing regexp, for a basic input: Checkout POC in playground |
This feature was originally requested on our internal Fider instance and will be developed by our team.
The current search feature allow us to find posts matching words, and we can use a few filters on the home page to display only some posts. This is great, but can be improved. Here come the...
Advanced search
This feature will be split in two parts, and a third may be realized later:
exact
,author
,votes
, etc...)Search operators
Presentation
The traditional simple search will still exist with words without any operator (i.e.
Webhook
,mention users
orsticky posts
...).An operator will be a simple word with an associated value, with the following syntax:
operator:"value"
.Operators could be inverted by prefixing them with an exclamation mark (i.e.
!operator:"value"
).The values could be combined using a comma, to symbolize a
OR
combination (i.e.operator:"val1,val2,val3"
).When applicable (elements can be ordered like numbers or dates), values can themselves be ranges, opened or closed (i.e.
operator:"valmin.."
,operator:"..valmax"
,operator:"valmin..valmax"
).They will be combined with
AND
when several are used at the same time (i.e.operator1:"value1" operator2:"value2"
).First list of operators
On terms
exact:"term"
= must contains exactly the given sequence of characterstitle:"term"
= same asexact
but only in the titledesc:"term"
= same asexact
but only in the descriptioncomment:"term"
= same asexact
but only in the commentsOn dates
open:"date"
= match the post creation dateactive:"date"
= match the post last activity dateresponse:"date"
= match the post response dateOn meta-data
author:"user"
= only from the given authorstatus:"status"
= only with a given statusvotes:"number"
= match the votes countwith:"user"
= with the participation of a user (in the comments)Special values
Some special values would allow us to create "generic" search query.
@me
= replaced with our username@now
= replaced with the current date@week
= replaced with the date one week ago@month
= replaced with the date a month agoExample queries
!active:"..@month,@week.."
), with at least 10 votes and which I didn't participated (commented):Advanced search zone
This will come after the operators and this is too early to state anything about it. Maybe it'll be a popup with fields and a "Search" button that generate the corresponding filter and paste it into the actual search bar.
First thoughts on the technical implementation
It is planed to create a query parser, to interpret the search query and transform it into a Go model, and then use this model to perform the actual search into the database. A little rework of the current requests may happen, as it seems to be very complex for the moment, even with a simple idea (textual search). Perhaps a better model or the usage of database stored procedures could help.
Then, to create the advanced search zone, a query builder will be created, to generate queries based on input fields of a form.
No extra modules or packages should be included.
The definition of this feature may evolve as it's not currently developed. But it will look like this 😄
The text was updated successfully, but these errors were encountered: