alphapapa / org-ql

A searching tool for Org-mode, including custom query languages, commands, saved searches and agenda-like views, etc.
GNU General Public License v3.0
1.4k stars 110 forks source link

[FR] Limit or filter number of results from org-ql-search #326

Open SterlingHooten opened 1 year ago

SterlingHooten commented 1 year ago

Is there a way to limit or "take" a number of results in org-ql-search? I see you can do this with an org-ql-block but I don't see this in the standard org-ql-search. I'm imagining a key like ":take".

I'm trying to implement the notion of "search for headings edited around the same time". All of my headings have a MODIFIED property which contains a timestamp. I want to be able to return a list (or org-sidebar buffer etc) with the 10 or 15 headings that were edited the closest in time before, and then also those closest and were edited after.

I can implement "all headings within some time delta" of a heading, which is useful, but not the same.

Thanks!

alphapapa commented 1 year ago

This seems like a useful idea, and it wouldn't take much code to implement. Patches welcome, or I'll get around to it eventually. Thanks.

ParetoOptimalDev commented 6 months ago

Would this apply to the items in org ql views? I also recently thought it would be nice to limit these to have 10 items each to give a good overview. Plus I sort by (todo reverse) so any items with NEXT float to the top anyway.