Can someone suggest a moere efficient expression

If you are experiencing problems with "Everything", post here for assistance.
Post Reply
searcher1
Posts: 24
Joined: Sun May 31, 2015 2:13 pm

Can someone suggest a moere efficient expression

Post by searcher1 »

Hi

I am using the following expression and it has a lot o repetition and the query takes a long time.

Here it is:
.wav pos-1 | .wav pos-2 | .wav pos-3 |.wav pos-4| .wav pos-5|.wav pos-6 |.wav pos-7 |.aif pos-1 | .aif pos-2 | .aif pos-3 |.aif pos-4| .aif pos-5|.aif pos-6 |.aif pos-7

Is there a more efficient expression I could use to get the same results and make the query run faster.

Thank you, you geniuses out there.

Regards

Angelo
therube
Posts: 4955
Joined: Thu Sep 03, 2009 6:48 pm

Re: Can someone suggest a moere efficient expression

Post by therube »

I wouldn't expect it to take a long time?
Don't see any reason why it should?

Verify that you do not have REGEX enabled.
(Don't think it would give you any results if you did.)
Verify that you are not matching Path.

Maybe set the Audio filter.
Instead maybe use the ext: function, ext:wav;aif.
Perhaps set file: modifier.
Perhaps use wholeworld, ww:

file: ext:wav;aif ww:pos <-1|-2|-3-4|-5-|-6|-7>

Problem with that is it is not going to be as precise in what it finds.

file: ext:wav;aif <pos-1|pos-2|pos-3|pos-4|pos-5|pos-6|pos-7>

That would be.

Just don't know if any of those methods would be more efficient then your original search?
Not really understanding why your original search would be inefficient?
Wouldn't know if some inefficiency creeps in after X number of ORs or something like that?
searcher1
Posts: 24
Joined: Sun May 31, 2015 2:13 pm

Re: Can someone suggest a moere efficient expression

Post by searcher1 »

Wow. Very interesting.
Thank you so much !

I'm a newbie at theses expressions. Just learning bits and pieces.
Your expressions work perfectly and seeing your examples is a great learning experience for me.

Here are the stats on these three variations on the expressions, yours and mine:

My original expression

pos-1|pos-2|pos-3|pos-4|pos-5|pos-6|pos-7|pos-1|pos-2|pos-3 |pos-4|pos-5|pos-6|pos-7
(8 seconds to query)
Accurate

Your expressions

file: ext:wav;aif ww:pos <-1|-2|-3|-4|-5-|-6|-7>
(.5 seconds to query)
Not totally accurate

file: ext:wav;aif <pos-1|pos-2|pos-3|pos-4|pos-5|pos-6|pos-7>
(2.5 seconds to query)
Accurate
void
Developer
Posts: 16669
Joined: Fri Oct 16, 2009 11:31 pm

Re: Can someone suggest a moere efficient expression

Post by void »

Code: Select all

ext:wav;aif pos- <pos-1|pos-2|pos-3|pos-4|pos-5|pos-6|pos-7>
Might be faster.
Try to limit the results as much as possible before using ORs (|).
Using | can be expensive, I am looking into optimizing multiple ORs for a future release.
searcher1
Posts: 24
Joined: Sun May 31, 2015 2:13 pm

Re: Can someone suggest a moere efficient expression

Post by searcher1 »

void wrote:

Code: Select all

ext:wav;aif pos- <pos-1|pos-2|pos-3|pos-4|pos-5|pos-6|pos-7>
Might be faster.
Try to limit the results as much as possible before using ORs (|).
Using | can be expensive, I am looking into optimizing multiple ORs for a future release.

Yes. Faster and accurate

The addition of pos- after the "Ext:wav;aif" part of the expression seems redundant because it included in the grouped section of the expression but it actually speeds up the search.

Why is that?
void
Developer
Posts: 16669
Joined: Fri Oct 16, 2009 11:31 pm

Re: Can someone suggest a moere efficient expression

Post by void »

Searches are executed from left to right.

First, Everything will find all files matching ext:wav;aif.
ext:wav;aif is very fast so this will reduce the number of results quickly.
Next, Everything will try to find pos- in all the results that matched ext:wav;aif above.
Searching for pos- is fast, and this will reduce the results by quite a bit more so we can finally search for <pos-1|pos-2|pos-3|pos-4|pos-5|pos-6|pos-7>.
This search is slow, but if we limit the results we have to perform the search on, as we have done above, it will improve the overall search performance.
If pos-1 doesn't match, then Everything will move onto pos-2, if that doesn't match Everything will try pos-3 and so on.

Even though the multiple searches for pos- may seem redundant, the first search for pos- will reduce the number of results before Everything searches for <pos-1|pos-2|pos-3|pos-4|pos-5|pos-6|pos-7>.
searcher1
Posts: 24
Joined: Sun May 31, 2015 2:13 pm

Re: Can someone suggest a moere efficient expression

Post by searcher1 »

Brilliant !

This is absolutely one of the greatest utilities.

Amazing.

thank you
Post Reply