honestbleeps / Reddit-Enhancement-Suite

Reddit Enhancement Suite
http://redditenhancementsuite.com
GNU General Public License v3.0
4.17k stars 877 forks source link

Advanced search wizard/form #1160

Open jewel-andraia opened 10 years ago

jewel-andraia commented 10 years ago

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.

matheod commented 10 years ago

Related #970

matheod commented 10 years ago

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

jewel-andraia commented 10 years ago

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

matheod commented 10 years ago

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

ivanatpr commented 9 years ago

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.

erikdesjardins commented 9 years ago

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

erikdesjardins commented 9 years ago

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

albino1 commented 9 years ago

+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.

jewel-andraia commented 8 years ago

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

erikdesjardins commented 8 years ago

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

jewel-andraia commented 8 years ago

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

jewel-andraia commented 8 years ago

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

erikdesjardins commented 7 years ago

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

miyu commented 4 years ago

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 commented 4 years ago

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!