Reddit-Enhancement-Suite icon indicating copy to clipboard operation
Reddit-Enhancement-Suite copied to clipboard

Advanced search wizard/form

Open jewel-andraia opened this issue 10 years ago • 15 comments

It would be swell to add a form to the search page with structured inputs for advanced options, such as timestamps <input type="date" name="from"> ... <input type="date" name="to">, subreddit multi-select (like in settings), <input type="text" name="domain">, etc.

jewel-andraia avatar Jun 01 '14 17:06 jewel-andraia

Related #970

matheod avatar Jun 10 '14 12:06 matheod

AFIK there is no way to set a from and to time, no ?

matheod avatar Jun 10 '14 14:06 matheod

to and from time

you can restrict search by time. the syntax isn't on the search wiki page, but it looks something like

timestamp: 1402414200000...1402414221636

jewel-andraia avatar Jun 10 '14 15:06 jewel-andraia

18:06:58 matheod_ http://www.reddit.com/search?q=(and+title%3A%27sunset%27+timestamp%3A1354348800..1354521600)&syntax=cloudsearch 18:07:05 andytuba that looks right 18:07:59 matheod_ it don't work with me 18:08:00 matheod_ http://www.reddit.com/r/Enhancement/search?q=test+timestamp%3A1302416318..1402416318&sort=new&t=all 18:08:14 andytuba try adding syntax=cloudsearch 18:08:17 andytuba to your query 18:09:21 matheod_ still doesn't work 18:09:26 matheod_ http://www.reddit.com/r/Enhancement/search?q=test+timestamp%3A1354348800..1354521600&sort=new&t=all&syntax=cloudsearch 18:10:10 andytuba i dunno man 18:10:19 andytuba take the thing that works and adapt that to what you want 18:10:51 andytuba like, gradually tweak/add bits to it 18:11:22 matheod_ http://www.reddit.com/search?q=%28and+title%3A%27a%27+timestamp%3A1354348800..1354521600%29&syntax=cloudsearch 18:11:23 matheod_ Hum 18:11:27 matheod_ it's a very specific syntax 18:11:34 matheod_ it's strange 18:11:58 matheod_ seem to work only with title 18:12:09 matheod_ Not sure we can really implement this :/ 18:12:26 andytuba shucks 18:13:57 andytuba http://www.reddit.com/r/redditdev/comments/1hpicu/whats_this_syntaxcloudsearch_do/ 18:14:17 andytuba that looks promising 18:16:18 andytuba (and author_field:"matheod" timestamp:##…## subreddit:restests) 18:16:25 andytuba &syntax=cloudsearch 18:16:28 andytuba that'll prob get you somewher 18:16:44 andytuba https://github.com/reddit/reddit/blob/master/r2/r2/lib/cloudsearch.py#L172-L326

matheod avatar Jun 10 '14 16:06 matheod

Timestamp searches seems like a good pain point for RES to address. This is a feature of reddit search that's virtually inaccessible to the average user. I doubt even the average reddit poweruser knows it exists.

Right now, in order to do a timestamp-based search you need to change your search query to use Lucene/cloudsearch's obscure syntax, convert whatever dates you're searching for into UNIX-style epoch timestamps, and manually add "&syntax=cloudsearch" to the search page's URL. This makes for a painful experience and is well beyond the capability of non-technical users.

ivanatpr avatar Jul 06 '15 21:07 ivanatpr

https://www.reddit.com/r/Enhancement/comments/3ksoe8/feature_request_custom_filter_date_ranges/

erikdesjardins avatar Sep 13 '15 16:09 erikdesjardins

https://www.reddit.com/r/Enhancement/comments/3snjvt/feature_request_allow_a_time_machine_button_to/

erikdesjardins avatar Nov 13 '15 17:11 erikdesjardins

+1

Having tried to do this manually several times, and getting frustrated with the conversions and system, I would gladly welcome this addition to RES. The fact that it doesn't exist in reddit proper still blows my mind.

albino1 avatar Nov 15 '15 08:11 albino1

https://www.reddit.com/r/Enhancement/comments/3utrjt/is_there_anyway_to_view_the_posts_on_a_subreddit/

jewel-andraia avatar Nov 30 '15 21:11 jewel-andraia

https://www.reddit.com/r/Enhancement/comments/3yvb1d/feature_request_custom_timeline_search_feature/

erikdesjardins avatar Dec 31 '15 16:12 erikdesjardins

https://www.reddit.com/r/Enhancement/comments/500q7e/feature_request_search_reddit_by_date/

jewel-andraia avatar Aug 28 '16 20:08 jewel-andraia

timestamp https://www.reddit.com/r/Enhancement/comments/5bnw8a/feature_request_a_way_to_subreddits_by_top_of/

jewel-andraia avatar Nov 07 '16 18:11 jewel-andraia

Timestamp is probably no longer feasible https://www.reddit.com/r/changelog/comments/6pi0kk/improving_search/dkpx8nu/?context=4

erikdesjardins avatar Jul 29 '17 17:07 erikdesjardins

It's less efficient API use, but could RES implement this via a client-side filter?

I've prototyped filtering by X Days Ago to Y Days Ago (e.g. 2*365;3*31 for 2 years ago to 3 months ago, or 3*31;0 shorthand 3*31 for 3 months ago til now) here in the form of a bookmarklet. It's compatible with infinite scrolling and expandos. I explored a few modes (hide filtered entries, fade filtered entries, 50%-scale filtered entries) -- enable them by uncommenting.

License: Public Domain

javascript:(() => {

var thresholds = prompt("days? (e.g. -3mo to now)", "3*31;0").split(";");
var lowerThreshold = +(new Date()) - eval(thresholds[0]) * 24 * 60 * 60 * 1000;
var upperThreshold = +(new Date()) - eval(thresholds[1] || 0) * 24 * 60 * 60 * 1000;
var seen = new Set();
setInterval(() => {
[...document.querySelectorAll(".thing")].forEach(thing => {
  if (seen.has(thing)) return;
  seen.add(thing);
  var dt = thing.querySelector("time")?.dateTime;
  if (!dt) return;
  var time = +(new Date(dt));
  if (lowerThreshold < time && time < upperThreshold) return;
  
  /* uncomment to hide entry */
  /* thing.style.display = "none"; /**/

  [".top-matter", ".midcol", ".rank", ".thumbnail"].forEach(sel => {
    var el = thing.querySelector(sel);

    /* uncomment to fade entry */
    /* el.style.opacity = "0.5"; /**/

    /* uncomment to fade entry but not thumbnail */
    /* if (sel != ".thumbnail") el.style.opacity = "0.5"; /**/

    /* uncomment to make entry smaller */
    /*
    el.style.transform = "scale(0.5)";
    el.style.transformOrigin = "top left"; /**/
  });
});

}, 1000);
})();

Here's my favorite mode (fade entry but not thumbnail) image

miyu avatar Jun 16 '20 05:06 miyu

I can contribute a patch if someone can tell me if RES has an internal way of doing the following:

  1. Add to search bar (links from: ...) with a label and calendar/textbox
  2. Hook page load & infinite scroll
  3. Event for applying appearance changes to listing thing rows

Edit: Oh wait, for anyone else looking for this, there's a tiny filter icon in RES that you can specify before/after dates with!

miyu avatar Jun 16 '20 07:06 miyu