-
Notifications
You must be signed in to change notification settings - Fork 388
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
[Feature Request]: FINAL search engine features for 9.5 #600
Comments
I am interested in working on a parser for this. Feedback on my current WIP grammar would be nice: ANDList = ORList ( ["AND"] ORList )* ;
ORList = Term ( "OR", Term )* ;
Term = Constraint | "(", ANDList, ")" ;
Constraint = [ConstraintType, ":"], Literal, "[", PropertyList, "]" ;
ConstraintType = "tag" | "mediaType" ; (* not a complete list *)
PropertyList = Property, (",", Property)* ;
Property = ULITERAL, "=", Literal ;
Literal = ULITERAL | QLITERAL ; Notes:
|
Looks pretty good to me! I'm just curious, is the reason for ANDLists and ORLists being separate things for which one takes precedence over the other? If so, does the current grammar make ANDs take precedence over ORs? That would be ideal |
Thanks! I am also much more happy with this that with my previous version. This is much simpler and should be easier to parse.
Yes!
No it does not, OR would be evaluated first here. AND taking precedence over OR would be more intuitive for me too, however iirc @CyanVoxel suggested this somewhere in the discussion on the discord and I generally don't care too much about it. (Cyan, If I am not supposed to ping you let me know, I asked on the discord before, but a big discussion broke out right after so I believe you missed it) |
Unless it was a looooong time ago, I don't remember preferring OR over AND; the opposite seems more intuitive to me as well. I know I brought up a preference for implicit AND when no operator is given, but I'm not sure if that's related here.
It's alright to ping me, I miss too much stuff to warrant not being pinged 🙃 |
Alright nvm then. I have a first go at the parser almost done (still with OR preference though) so I might open a Draft PR in the next days. |
Updated Grammar (AND now binds stronger than OR as is normal): ORList = ANDList ( "OR", ANDList)* ;
ANDList = Term ( ["AND"] Term )* ;
Term = Constraint | "(", ORList, ")" ;
Constraint = [ConstraintType, ":"], Literal, "[", PropertyList, "]" ;
ConstraintType = "tag" | "mediaType" ; (* not a complete list *)
PropertyList = Property, (",", Property)* ;
Property = ULITERAL, "=", Literal ;
Literal = ULITERAL | QLITERAL ; Notes:
|
With this proposal we are currently missing a way to search for untagged files. My idea on how to fix this would be the following syntax: The advantage of this is that this could also be used to add other special criteria like e.g. |
I like this approach. Simply typing "empty" or "untagged" was nice in 9.4, but realistically it shadowed any potential tags with those names. This new approach avoids that issue while also making sure it plays nicely with the grammar 👍 |
Added a table for all current search queries. Let me know if anything needs to be changed |
Checklist
Description
this issue describes the current consensus on what features the search engine will have for the 9.5 release.
REQUIRED for 9.5:
new queries - a definition and implementation of a "query language" which can be converted to SQL queries to be made against the database
tag
,tag_id
,mediatype
,filetype
,path
, andspecial
queries: types of queries to be run against entries/tags in the databasestring
tag: Mario
tag: Mario[parent=nintendo]
int
tag_id: 1001
name
property of MediaCategories (will eventually use the translated name)string
mediatype: video
string
filetype: jpg
string
path: folder/*
"untagged"
"unlinked"
special: untagged
STRETCH GOALS for 9.5
The text was updated successfully, but these errors were encountered: