Topic: [Feature] Better tag search syntax / Optional advanced tag search

Posted under Site Bug Reports & Feature Requests

Preface
I remember a while back when e6 was one of the only sites to have an OR feature for tagging, then the biggest of the r34 sites (https://rule34.xxx) made their current system which has the capability to enter super advanced tag filtering by using parentheses to separate sections of tags. Their cheat sheet covers the basics but after playing around with it I've learned you can do stuff like this:

( ( tag1 ( tag2 ~ tag3 ) ) ~ ( tag4 ( tag5 ~ tag6 ) ) )

This line in specific would be equivalent to a single e6 search query that can search for posts returned by this search query:

tag1 ~tag2 ~tag3

OR this search query:

tag4 ~tag5 ~tag6

Which is not currently possible. As both a person who's incredibly picky about posts (autism) and who really likes logic systems (digital electronics, programming, etc.), a similar search system here would be unimaginably convenient.

Requested feature overview description.
A more advanced tag search syntax with a similar capability to the one described above, most likely via implementing the ability to nest "smaller" search queries between parentheses that allows them to be considered in either 'or' or 'and' operations, with such nested search queries being able to be placed within another nested search query. Since such a syntax could be a hassle for many site viewers who wouldn't care enough to learn it or have to basically write code to search for posts, it could be implemented as an optional advanced search.

Why would it be useful?
1.It would enable users to/make it easier for users to search for specific types of posts or for filtering out specific situations from more general search queries. This comes into play for tags that can be used for many possible situations, for example:
'size_difference' has a plethora of related tags that apply to specifying which gender, form (human, humanoid, anthro, feral, or taur), etc. of a character (or characters) is larger or smaller than other present characters, tags that specify the role, position, and penetration of smaller and larger characters during sex, and a few other related tags like micro, macro, and the tags that denote a difference in body part size between characters.

2.It would enable users to compensate for any existing tag inconsistencies. At present I can't think of any examples, but I know I've used the r34 search syntax to do this in the past.

What part(s) of the site page(s) are affected?
Search syntax, either by modifying the existing system or by adding an advanced search option.

I don't know whether E6's framework would allow for implementing such a feature, at least in a way that is performance efficient, but I doubt most users would use it to make super complex searches regularly enough to cause problems, especially if it's separate from the existing "simple" search.

IT'S HERE! This feature is now live! The search cheatsheet hasn't been updated yet, but you can check the syntax here and, if it isn't clear enough there, play with a live demo for it here (just change the "Test String" to the query you want, & hover over the colored text; the "Group" names tell you what the server will view it as, with "subquery" being the subsearch. Nested groups work (e.g. ~( aaa -( ~bbb ~ccc ) ) ~( ddd eee ) ), but the demo won't highlight elements inside a subquery). A huge thank you to Tarrgon for their extremely instructive earlier attempt at this.

The tl;dr is to place the grouped search inside parentheses separated by a space (the space is required) with an optional ~/- prefix.
~( aaa -( ~bbb ~ccc ) ) ~( ddd eee ) = Group 1 OR Group 2
Group 1 = aaa AND NOT Group 1A
Group 1A = bbb OR ccc
Group 2 = ddd AND eee

aacafah said:
IT'S HERE! This feature is now live! The search cheatsheet hasn't been updated yet, but you can check the syntax here and, if it isn't clear enough there, play with a live demo for it here (just change the "Test String" to the query you want, & hover over the colored text; the "Group" names tell you what the server will view it as, with "subquery" being the subsearch. Nested groups work (e.g. ~( aaa -( ~bbb ~ccc ) ) ~( ddd eee ) ), but the demo won't highlight elements inside a subquery). A huge thank you to Tarrgon for their extremely instructive earlier attempt at this.

The tl;dr is to place the grouped search inside parentheses separated by a space (the space is required) with an optional ~/- prefix.
~( aaa -( ~bbb ~ccc ) ) ~( ddd eee ) = Group 1 OR Group 2
Group 1 = aaa AND NOT Group 1A
Group 1A = bbb OR ccc
Group 2 = ddd AND eee

I can appreciate someone proposing a feature and actually implementing it!
Great job!