Topic: [Feature/Rejected] Lambda Metatag for Customizable Search Filtering

Posted under Site Bug Reports & Feature Requests

I usually filter my searches with "score:>100" or something similar to screen out low-quality results. I imagine many do the same. However, I've noticed that older, lower-quality posts manage to make it through this filter on account of them having more time to accrue votes. I'd like to be able to filter by score per unit time; however, this is likely too niche a case to warrant a change of it alone. How about an extendible framework which allows filtering by basic algebraic operations on numerical metatags?

I imagine the searches are passed to an SQL for result delivery. A typical search would be "male/male order:score" which would be passed to something more efficient than

SELECT * FROM database.table WHERE tags LIKE '%male/male%' ORDER BY score LIMIT 60 

All that would be required to implement this is to add a metatag "lambda" which creates a dummy variable as follows: "male/male lambda:rate=score/date order:rate" passes to

SELECT *, score / DATEDIFF(CURRENTDATE(), date)  AS rate FROM database.table WHERE tags LIKE '%male/male%' ORDER BY rate LIMIT 60 

Support would only be required for those metatags which have a convenient representation as a numeric type, and later implementations could extend this to other types. I imagine whoever is using the description regex functionality would love it.

Alternatively, y'all could let us have at it with raw SQL queries. That'd be epic; I can imagine that enabling some cool data science stuff.

Updated by KiraNoot

I doubt you will get this feature.

You could do the calculations on your end, and combine it with the date range syntax.

Your formula could even give a slight bonus to very old posts, since less people used the site several years ago and scores tend to be lower.

domestic_cat score:>100 date:6_months_ago (1532 posts)
domestic_cat score:>123 date:12_months_ago..6_months_ago (1215 posts)
domestic_cat score:>169 date:5_years_ago..year (1252 posts)
domestic_cat score:>123 date:15_years_ago..5_years_ago (812 posts)

The starting problem is that the site doesn't use SQL for searching. The follow up problem is that allowing arbitrary script execution is a blatant security threat, and every piece of documentation for the search engine says not to allow user input to interact directly with/be combined with scripts. So I will have to reject this.

  • 1