Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Request] Custom Filters for Path #79

Closed
AJolly opened this issue Jan 17, 2024 · 13 comments
Closed

[Request] Custom Filters for Path #79

AJolly opened this issue Jan 17, 2024 · 13 comments
Labels
enhancement New feature or request todo Something to be implemented, may or may not be in the works yet.

Comments

@AJolly
Copy link

AJolly commented Jan 17, 2024

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.

@AJolly AJolly added the enhancement New feature or request label Jan 17, 2024
@lin-ycv
Copy link
Owner

lin-ycv commented Jan 18, 2024

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

@lin-ycv lin-ycv closed this as completed Jan 18, 2024
@lin-ycv lin-ycv added duplicate This issue or pull request already exists and removed enhancement New feature or request labels Jan 18, 2024
@AJolly
Copy link
Author

AJolly commented Jan 18, 2024

  1. Where do we configure the default filter?

@AJolly
Copy link
Author

AJolly commented Jan 18, 2024

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

@lin-ycv
Copy link
Owner

lin-ycv commented Jan 19, 2024

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.

@lin-ycv lin-ycv added the need more info Partially resolved or need more info to resolve label Jan 19, 2024
@AJolly
Copy link
Author

AJolly commented Jan 22, 2024

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 lin-ycv changed the title [Request] Default Filter [Request] Custom Filters for Path Jan 22, 2024
@lin-ycv lin-ycv added enhancement New feature or request and removed duplicate This issue or pull request already exists need more info Partially resolved or need more info to resolve labels Jan 22, 2024
@lin-ycv
Copy link
Owner

lin-ycv commented Jan 22, 2024

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.

@lin-ycv lin-ycv reopened this Jan 22, 2024
@lin-ycv lin-ycv added the todo Something to be implemented, may or may not be in the works yet. label Jan 22, 2024
@AJolly
Copy link
Author

AJolly commented Jan 22, 2024

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
Copy link
Owner

lin-ycv commented Jan 22, 2024

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
Copy link
Author

AJolly commented Jan 22, 2024

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
Copy link

pzhren commented Jun 6, 2024

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
Copy link
Owner

lin-ycv commented Jun 6, 2024

@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
Copy link

pzhren commented Jun 6, 2024 via email

@lin-ycv
Copy link
Owner

lin-ycv commented Jun 6, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request todo Something to be implemented, may or may not be in the works yet.
Projects
None yet
Development

No branches or pull requests

3 participants