lin-ycv / EverythingPowerToys

Everything search plugin for PowerToys Run
Eclipse Public License 2.0
2.2k stars 57 forks source link

[Request] Custom Filters for Path #79

Closed AJolly closed 7 months ago

AJolly commented 7 months ago

I'd love a way to set a default search / filter that gets applied.

I'm trying to get powertoys run to pick up portable apps and scripts and include them in the results, search everything works great for this, if I could have it set a default filter, or otherwise have more fine grained priority for results.

lin-ycv commented 7 months ago

Default filters are already implemented Additional filters can be customized in settings.toml

AJolly commented 7 months ago

1) Where do we configure the default filter?

AJolly commented 7 months ago

Also - What's the best way to debug our filters, I'm getting significantly more results in search everything directly.

lin-ycv commented 7 months ago

Open the file called settings.toml in a text editor, default filters are there. What are your settings in everything and PTR? What's your max setting in PTR? If you're not using any filters, all the plugin is doing is passing the query to everything, so unless you have some custom settings in everything, results should be the same. If you're using filters, there's a chance the filter is not supported by the sdk, or I haven't parsed it correctly, in that case I need to know what filters you're using.

AJolly commented 7 months ago

When I say default filter - I'm looking to have a filter automatically applied without me needing to specify that specific filter.

Max settings in PTR for Everything is 250.

Various weirdness: settings.toml:

Search filters, filters result with extension type, seperated by ;

Audio: = aac;ac3;aif;aifc;aiff;amr;ape;au;cda;dts;fla;flac;it;m1a;m2a;m3u;m4a;m4b;m4p;mid;midi;mka;mod;mp2;mp3;mpa;ogg;opus;ra;rmi;spc;rmi;snd;umx;voc;wav;weba;wma;xm Zip: = 7z;ace;arj;bz2;cab;gz;gzip;jar;r00;r01;r02;r03;r04;r05;r06;r07;r08;r09;r10;r11;r12;r13;r14;r15;r16;r17;r18;r19;r20;r21;r22;r23;r24;r25;r26;r27;r28;r29;rar;tar;tgz;z;zip Doc: = c;cc;chm;cpp;cs;css;csv;cxx;doc;docm;docx;dot;dotm;dotx;epub;gh;h;hpp;htm;html;hxx;ini;java;js;json;lua;mht;mhtml;mobi;odp;ods;odt;pdf;php;potx;potm;ppam;ppsm;ppsx;pps;ppt;pptm;pptx;pub;py;rtf;sldm;sldx;thmx;txt;vsd;wpd;wps;wri;xlam;xls;xlsb;xlsm;xlsx;xltm;xltx;xml;vb Exe: = bat;cmd;exe;msi;msp;msu;ps1;scr;lnk ccdca: = c:\ccdc\portableapps ccdcs: = c:\ccdc\portableapps|c:\ccdc\scripts|c:\ccdc\sysinternals|c:\ccdc\avalerts\nirsoft|c:\ccdc\commandlinetools Pic: = ani;apng;bmp;bpg;cur;gif;ico;jfi;jfif;jif;jpe;jpeg;jpg;pcx;png;psb;psd;rle;svg;tga;tif;tiff;webp;wmf ccdc: = c:\ccdc\portableapps|c:\ccdc\scripts|c:\ccdc\sysinternals|c:\ccdc\avalerts\nirsoft|c:\ccdc\commandlinetools|<c:\users\jolly "start menu">|"C:\ProgramData\Microsoft\Windows\Start Menu\Programs\" ext:exe;lnk;cmd;bat;ahk !sync-conflict Video: = 3g2;3gp;3gp2;3gpp;amv;asf;asx;avi;bdmv;bik;d2v;divx;drc;dsa;dsm;dss;dsv;evo;f4v;flc;fli;flic;flv;hdmov;ifo;ivf;m1v;m2p;m2t;m2ts;m2v;m4v;mkv;mp2v;mp4;mp4v;mpe;mpeg;mpg;mpls;mpv2;mpv4;mov;mts;ogm;ogv;pss;pva;qt;ram;ratdvd;rm;rmm;rmvb;roq;rpm;smil;smk;swf;tp;tpr;ts;vob;vp6;webm;wm;wmp;wmv

searches with the filter ccdca do not work: image

searches with ccdcs or ccdc work mostly fine:

image

but everything returns 12 results image

PTR returns 9. image

lin-ycv commented 7 months ago

Settings.Toml was design with extension filters in mind, you're using it as a path filter, which doesn't quite work because the plugin prepends your custom macro with ext:, which indicates to everything that you want to search for extension types, but it then receives a path instead. . This would be something I have think about how to implement.

AJolly commented 7 months ago

Hm. Is there a way to run multiple instances of the plugin so we could connect them to different named instances? That'd also let me have a "default" filter, or let me connect to search everything 1.5, which supports referencing a filter in a search (filter:ccdc) https://www.voidtools.com/forum/viewtopic.php?f=12&t=10176#filter

lin-ycv commented 7 months ago

Named instance isn't a feature that's supported by the sdk, see #40 . Named instance would be something that would have to be implemented by voidtools. You can configure 1.5a to work with this plugin #74 , but whether the newer features will work is unknown, as I've not tested that.

AJolly commented 7 months ago

Ah thats useful to know. Looks like we'd have to recompile the sdk to support connecting to a named instance: https://www.voidtools.com/forum/viewtopic.php?p=41186#p41186

Still would be useful to have multiple plugin instances if we could reference a default filter. I can confirm using 1.5 lets us reference a filter as part of the search: image

pzhren commented 3 months ago

Hm. Is there a way to run multiple instances of the plugin so we could connect them to different named instances? That'd also let me have a "default" filter, or let me connect to search everything 1.5, which supports referencing a filter in a search (filter:ccdc) https://www.voidtools.com/forum/viewtopic.php?f=12&t=10176#filter

Please tell me how to set the default filter in setting.toml, for example I only want to search pdf.

lin-ycv commented 3 months ago

@pzhren If you only want pdf files, just include .pdf in your query If you must use filters for whatever reason: On 1.5, you don't need to configure setting.toml, configure it in 1.5 directly On 1.4, in setting.toml you can configure it like this pdf: = pdf;

pzhren commented 3 months ago

Thanks Is there a way to make it search only pdf by default and omit .pdf? I am v1.5 ---- Replied Message ---- FromLin Yu-Chieh @.>Date6/6/2024 @.>CcAndy @.>, @.>SubjectRe: [lin-ycv/EverythingPowerToys] [Request] Custom Filters for Path (Issue #79) @pzhren If you only want pdf files, just include .pdf in your query If you must use filters for whatever reason: On 1.5, you don't need to configure setting.toml, configure it in 1.5 directly On 1.4, in setting.toml you can configure it like this pdf: = pdf; — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>

lin-ycv commented 3 months ago

@pzhren not that I'm aware of? You can set p: = .pdf then use p:searchterm That should be the simplest. If you want to use this plugin to always only search for certain files/folders/extensions, you can open a new feature request.