how to search "=" with system-index

Discussion related to "Everything" 1.5 Alpha.
Post Reply
nuobeike
Posts: 12
Joined: Mon Oct 11, 2021 9:56 am

how to search "=" with system-index

Post by nuobeike »

for example,search "1+1=2" with system index
si:"1+1=2" didnt work, has no idea how to escape equal sign
therube
Posts: 5043
Joined: Thu Sep 03, 2009 6:48 pm

Re: how to search "=" with system-index

Post by therube »

(Not that I know what si: is supposed to do, but I crash with it, so...)
x86, if that matters, crash dump:
Last edited by void on Tue Nov 01, 2022 3:10 am, edited 1 time in total.
Reason: removed crash dump
horst.epp
Posts: 1455
Joined: Fri Apr 04, 2014 3:24 pm

Re: how to search "=" with system-index

Post by horst.epp »

therube wrote: Mon Oct 31, 2022 2:50 pm (Not that I know what si: is supposed to do, but I crash with it, so...)
x86, if that matters, crash:
Everything SI.1.7z
si: (systemindex:) queries the Windows indexing and for me its one the most usefull functions of Everything.
It overcomes the limit of Everythings datebase in RAM
if you need a large amount of content indexing.
therube
Posts: 5043
Joined: Thu Sep 03, 2009 6:48 pm

Re: how to search "=" with system-index

Post by therube »

queries the Windows indexing
Oh, is that some sort of service?
In that case, I have have it disabled on my end, or if not actually disabled, it may be set to index - nothing (in case that might be a factor in the crash)?


(Indexing Options appears to show that only "Internet Explorer History" is "indexed".
No clue why I'd even have that, as I've never used IE [directly].)
tuska
Posts: 1095
Joined: Thu Jul 13, 2017 9:14 am

Re: how to search "=" with system-index

Post by tuska »

therube wrote: Mon Oct 31, 2022 7:03 pm
queries the Windows indexing
Oh, is that some sort of service?
In that case, I have have it disabled on my end, or if not actually disabled, it may be set to index - nothing ...
Here are pictures regarding 'Windows Search'.

See also:
- Advanced Query Syntax
- system-index:, si:

Just out of interest:
Is there a special reason why you use Everything 1.5 x86 and not x64?
void
Developer
Posts: 17069
Joined: Fri Oct 16, 2009 11:31 pm

Re: how to search "=" with system-index

Post by void »

Use double quotes to escape punctuation with Advanced Query Syntax.

To pass a double quote to si: please use &quot:

For example:

si:&quot:1+1=2&quot:

Windows Search will see the query as:
"1+1=2"



Double quotes (") are used by Everything to escape spaces.

For example:

si:"content:abc date:today"

Windows search will see the query:
content:abc date:today
(without the quotes)



I will add a si*: search function to treat the rest of the search as Advanced Query Syntax.

For example:

si*:"1+1=2"

When implemented, Windows Search will see the query as:
"1+1=2"



Thanks for the crash report therube,
This crash will be fixed in the next alpha update.
I'll make another post here once si* is ready and the crash is fixed.
nuobeike
Posts: 12
Joined: Mon Oct 11, 2021 9:56 am

Re: how to search "=" with system-index

Post by nuobeike »

void wrote: Tue Nov 01, 2022 4:42 am Use double quotes to escape punctuation with Advanced Query Syntax.

To pass a double quote to si: please use &quot:

For example:

si:&quot:1+1=2&quot:

Windows Search will see the query as:
"1+1=2"



Double quotes (") are used by Everything to escape spaces.

For example:

si:"content:abc date:today"

Windows search will see the query:
content:abc date:today
(without the quotes)



I will add a si*: search function to treat the rest of the search as Advanced Query Syntax.

For example:

si*:"1+1=2"

When implemented, Windows Search will see the query as:
"1+1=2"



Thanks for the crash report therube,
This crash will be fixed in the next alpha update.
I'll make another post here once si* is ready and the crash is fixed.
Thank you void.
How to escape (:), for example if I want to search "A:B", it did not work:
si:&quot:A:B&quot:
void
Developer
Posts: 17069
Joined: Fri Oct 16, 2009 11:31 pm

Re: how to search "=" with system-index

Post by void »

si:&quot:A:B&quot:

appears to give the correct SQL statement:

Code: Select all

SELECT "System.ItemPathDisplay" FROM "SystemIndex" WHERE CONTAINS(*,'"a:b"',3081)


I'll show the SQL statement in the debug console in the next alpha update.
The results are odd though, I'm getting matches when the content does not contain a:b
Maybe this is a limitation with the system search manager?



si:abc
=>

Code: Select all

SELECT "System.ItemPathDisplay" FROM "SystemIndex" WHERE CONTAINS(*,'"abc*"',3081)
si:&quot:abc&quot:
=>

Code: Select all

SELECT "System.ItemPathDisplay" FROM "SystemIndex" WHERE CONTAINS(*,'"abc"',3081)
nuobeike
Posts: 12
Joined: Mon Oct 11, 2021 9:56 am

Re: how to search "=" with system-index

Post by nuobeike »

void wrote: Wed Nov 02, 2022 2:21 am si:&quot:A:B&quot:

appears to give the correct SQL statement:

Code: Select all

SELECT "System.ItemPathDisplay" FROM "SystemIndex" WHERE CONTAINS(*,'"a:b"',3081)
si:&quot:A:B&quot:, this works fine here.

But I found a weird problem.
There is "1234567,7654321" in txt file,

si:&quot:123&quot:
=> no result

si:&quot:1234567&quot:
=> the result is good
void
Developer
Posts: 17069
Joined: Fri Oct 16, 2009 11:31 pm

Re: how to search "=" with system-index

Post by void »

si:&quot:123&quot:
=> no result
This is expected.
Windows Search will match whole words when using quotes.

si:&quot:123&quot:
=>

Code: Select all

SELECT "System.ItemPathDisplay" FROM "SystemIndex" WHERE CONTAINS(*,'"123"',3081)

Please try without quotes:
si:123
=>

Code: Select all

SELECT "System.ItemPathDisplay" FROM "SystemIndex" WHERE CONTAINS(*,'"123*"',3081)
Note the asterisk (*) after 123
This will match words starting with 123



BTW: Everything doesn't generate these SQL statements.
This is done by the Windows Search Manager.
I'm wondering if I need to add a search function to perform a direct SQL search..
nuobeike
Posts: 12
Joined: Mon Oct 11, 2021 9:56 am

Re: how to search "=" with system-index

Post by nuobeike »

void wrote: Wed Nov 02, 2022 4:25 am BTW: Everything doesn't generate these SQL statements.
This is done by the Windows Search Manager.
I'm wondering if I need to add a search function to perform a direct SQL search..
That sounds great :lol:
void
Developer
Posts: 17069
Joined: Fri Oct 16, 2009 11:31 pm

Re: how to search "=" with system-index

Post by void »

Everything 1.5.0.1327a fixes as crash with si: on x86.



Everything 1.5.0.1327a adds a new search function syntax: function*: to eat the remaining search text.

For example:

si*:"1+1=2"

(note the * after si)

will treat "1+1=2" as literal for the si: search function.



This might also be useful for regex:

regex*:a regex search with spaces and "quotes"!



I experimented with adding an siselect: search function.
However, I didn't keep this as it didn't give me any more control over the search and it was also dangerous as users could potentially drop tables.



The si: SQL statement is now shown in the debug console (Tools -> Debug -> Console)
nuobeike
Posts: 12
Joined: Mon Oct 11, 2021 9:56 am

Re: how to search "=" with system-index

Post by nuobeike »

void wrote: Thu Nov 03, 2022 5:25 am
si*:"1+1=2"

(note the * after si)

will treat "1+1=2" as literal for the si: search function.

The si: SQL statement is now shown in the debug console (Tools -> Debug -> Console)
Hi,void,
I found a problem with si* when searching (;)
si:"&quot:AB;&quot:" -------> ok
si*:"AB;"--------------> no result


and btw,
SQL statement isn't shown in the debug console, before update, there was searching log, but after update, there is nothing
void
Developer
Posts: 17069
Joined: Fri Oct 16, 2009 11:31 pm

Re: how to search "=" with system-index

Post by void »

What version of Everything are you using?

I'm seeing the expected results here.

si:"&quot:AB;&quot:"
=>
SQL: SELECT "System.ItemPathDisplay" FROM "SystemIndex" WHERE CONTAINS(*,'"AB;"',3081)



si*:"AB;"
=>
SQL: SELECT "System.ItemPathDisplay" FROM "SystemIndex" WHERE CONTAINS(*,'"AB;"',3081)

Both searches give the same SQL query.



Please note that if you change the search from:
si:"&quot:AB;&quot:"
to:
si*:"AB;"

No SQL query is performed and the same results are returned.
"same results" should be shown in the log in Magenta color.


Please try clearing the search box first, then searching for si*:"AB;"



What is shown in your debug console?
nuobeike
Posts: 12
Joined: Mon Oct 11, 2021 9:56 am

Re: how to search "=" with system-index

Post by nuobeike »

void wrote: Thu Nov 24, 2022 1:58 am What version of Everything are you using?
I was using 1327a, and I just update it to 1329, the debug log works fine now.

si*:"AA;" ------result is ok now
si*:""AA""-------ok
si*:""AA";"----------no ok

try to search ("AA";), the log is below:

search 'si*:""AA";"' filter '' sort 5 ascending 0
parse flags 00000000 type 20c01100
FOLDER TERM START 000000000311fef8 M 00000000004fdc60 N 00000000004fdd80
000000000311fef8 20e01100 M 00000000004fdc60 N 00000000004fdd80 OP 509 ""AA";"
FILE TERM START 000000000311fef8 M 00000000004fdc60 N 00000000004fdd80
000000000311fef8 20e01100 M 00000000004fdc60 N 00000000004fdd80 OP 509 ""AA";"
SQL: SELECT "System.ItemPathDisplay" FROM "SystemIndex" WHERE CONTAINS(*,'"AA" AND ";"',2052)
void
Developer
Posts: 17069
Joined: Fri Oct 16, 2009 11:31 pm

Re: how to search "=" with system-index

Post by void »

si*:""AA";"'
=>
SQL: SELECT "System.ItemPathDisplay" FROM "SystemIndex" WHERE CONTAINS(*,'"AA" AND ";"',2052)
I see the same thing.
This is just how the Windows search manager processes multiple double quotes.
The Windows search manager builds the SQL query, not Everything.

The following should give the best results:
si*:"AA;"

using si*: will pass the quotes to the Windows search manager.
Post Reply