I'd appreciate an option to do a search on multiple words at the same time
for an AND search.
Example: I want to search for an author named "JOHN SMITH". The filename
name could be saved as "J SMITH", "JOHN SMITH", or "SMITH, JOHN". I'd like
to enter "j smith" and have all 3 occurrences returned. It would be nice to
enter something like "j+smith" or "j smith" and have a search on multiple
words.
Neat idea! I'm not sure what kind of syntax for that would be a good idea though. Something simple like + or & won't cut it since those can be valid file name characters too, unless I break the current behavior and require users to use a backslash to escape those characters from now on (which I would rather not do). Or unless I introduce a new mode, like how regexes begin with >. But in that case the syntax needs to be robust enough that I don't have to introduce a new mode again later for new functionality. Any ideas?
Last edit: - 2018-04-12
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
As a workaround in the meantime, remember that you can always filter by one of your keywords, then right-click the entries, dump the table, then do the rest of your filtering in another program (like Excel). It's annoying, but it can still be done in batch and should be a viable alternative if you only need to do this occasionally.
Last edit: - 2018-04-12
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Nope that won't work. Colons are valid both for drive letters and for alternate data streams, so right now that would list any file that has a stream named "j smith".
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
Anonymous
-
2018-04-13
How about a double greater than sign? ">>j smith"
I do a lot of searches like this using "Index Your Files".
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Haha, well technically the first > implies regex mode, so the second one means you want a regex beginning with >. But that would probably be useless, so this could be made to work.
I'm afraid my point may have been lost here, though. I wasn't asking what character to begin with. That's easy enough to solve (e.g. < would work). I was asking, more generally, what the syntax should look like.
For example, if the only thing I do is solve your AND problem with >>, then tomorrow someone will ask that I solve the OR problem, so suddenly I'll need another syntax for that (so should I use >>> then?!). Then the next day someone else will come along and complain that they can only AND two words, not two regexes, etc... it can become arbitrarily complicated.
And it's not just this... who knows, maybe sometime in the future someone will get the idea that users should be able to type something else, like commands, into the box, such as notepad foo. Now suddenly I'll need an entirely new syntax for commands, and if I've already used up all the easy mode indicators for basic things (>, <, etc.) then I can't come up with an easy syntax for that.
What I'm trying to figure out is, what kind of syntax can I introduce that is:
(a) easy to use,
(b) not too difficult to implement, and
(c) extensible in the future.
It's easy enough for me to solve the specific problem you're asking, but then the solution will be so limited that I can't extend it in the future if I need to. I'm trying to avoid that problem.
(If you don't have any ideas though, that's fine; I'll try to come up with something myself when I get the chance. I was just asking in case you might already have some thoughts on this.)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
Anonymous
-
2018-04-13
Well, I just wrote a Search for my webpage. I have 2 fields that I search on; the TITLE and ARTIST of a song. Therefore, I used the AND search for the site.
You are correct, my Search request may be more of a request for me but I would think anyone searching music files would be interested.
I also think an average user does not konw how to use regular expressions.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
Anonymous
-
2018-04-20
Simple PHP code to find a Seacrh String using AND:
$find = trim(str_replace(' ', ' ', $find)); # trim excess spaces
$findarray = explode(' ', $find); # turn Search string into an array
$found = TRUE; # assume string is found
$findstring = $filename; # Set $findstring to the current filename
for($b = 0; $b < count($findarray); $b++) { # loop through $findarray
if(stripos($findstring, $findarray[$b]) === FALSE) $found = FALSE; # if array value is not find the set it to FALSE
}
if($found == FALSE) continue; # move on to next filename with displaying
echo $filename; # display the found filename
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Haha aw, thanks! Main thing I need right now is a good design and a good chunk of time to implement it, but thanks for trying to help with the implementation!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi! I've uploaded a new version that should make this possible with regexes.
(In fact, it was already almost possible, but it was broken due to a bug.)
To search for JohnANDSmith, you can now use (?=...) as follows:
>(?=.*John[^\\]*\\?$)(?=.*Smith[^\\]*\\?$).*
You can also add more terms by inserting additional similar (?=...) clauses.
It will be slower than a normal search, but hopefully it will still be usable.
Last edit: - 2018-05-07
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
Anonymous
-
2019-10-17
(?=.John[^\]\?$)(?=.Smith[^\]\?$).*
Yes, that looks like a very simple and intuitive syntax indeed. Just meaning AND.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
Anonymous
-
2019-10-17
I never claimed it was easy or intuitive. I was just trying to help you find a way to do this, otherwise you wouldn't be able to do this at all.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I'd appreciate an option to do a search on multiple words at the same time
for an AND search.
Example: I want to search for an author named "JOHN SMITH". The filename
name could be saved as "J SMITH", "JOHN SMITH", or "SMITH, JOHN". I'd like
to enter "j smith" and have all 3 occurrences returned. It would be nice to
enter something like "j+smith" or "j smith" and have a search on multiple
words.
Neat idea! I'm not sure what kind of syntax for that would be a good idea though. Something simple like
+
or&
won't cut it since those can be valid file name characters too, unless I break the current behavior and require users to use a backslash to escape those characters from now on (which I would rather not do). Or unless I introduce a new mode, like how regexes begin with>
. But in that case the syntax needs to be robust enough that I don't have to introduce a new mode again later for new functionality. Any ideas?Last edit: - 2018-04-12
As a workaround in the meantime, remember that you can always filter by one of your keywords, then right-click the entries, dump the table, then do the rest of your filtering in another program (like Excel). It's annoying, but it can still be done in batch and should be a viable alternative if you only need to do this occasionally.
Last edit: - 2018-04-12
You could send a "brute force" search query via AutoHotkey.
You'll get some extra files due to the
.*
, so adjust as needed.How about beginning a line with a colon (non-valid filename character) so you would enter ":j smith"?
Nope that won't work. Colons are valid both for drive letters and for alternate data streams, so right now that would list any file that has a stream named "j smith".
How about a double greater than sign? ">>j smith"
I do a lot of searches like this using "Index Your Files".
Haha, well technically the first
>
implies regex mode, so the second one means you want a regex beginning with>
. But that would probably be useless, so this could be made to work.I'm afraid my point may have been lost here, though. I wasn't asking what character to begin with. That's easy enough to solve (e.g.
<
would work). I was asking, more generally, what the syntax should look like.For example, if the only thing I do is solve your AND problem with
>>
, then tomorrow someone will ask that I solve the OR problem, so suddenly I'll need another syntax for that (so should I use>>>
then?!). Then the next day someone else will come along and complain that they can only AND two words, not two regexes, etc... it can become arbitrarily complicated.And it's not just this... who knows, maybe sometime in the future someone will get the idea that users should be able to type something else, like commands, into the box, such as
notepad foo
. Now suddenly I'll need an entirely new syntax for commands, and if I've already used up all the easy mode indicators for basic things (>
,<
, etc.) then I can't come up with an easy syntax for that.What I'm trying to figure out is, what kind of syntax can I introduce that is:
(a) easy to use,
(b) not too difficult to implement, and
(c) extensible in the future.
It's easy enough for me to solve the specific problem you're asking, but then the solution will be so limited that I can't extend it in the future if I need to. I'm trying to avoid that problem.
(If you don't have any ideas though, that's fine; I'll try to come up with something myself when I get the chance. I was just asking in case you might already have some thoughts on this.)
Well, I just wrote a Search for my webpage. I have 2 fields that I search on; the TITLE and ARTIST of a song. Therefore, I used the AND search for the site.
You are correct, my Search request may be more of a request for me but I would think anyone searching music files would be interested.
I also think an average user does not konw how to use regular expressions.
Simple PHP code to find a Seacrh String using AND:
$find = trim(str_replace(' ', ' ', $find)); # trim excess spaces
$findarray = explode(' ', $find); # turn Search string into an array
$found = TRUE; # assume string is found
$findstring = $filename; # Set $findstring to the current filename
for($b = 0; $b < count($findarray); $b++) { # loop through $findarray
if(stripos($findstring, $findarray[$b]) === FALSE) $found = FALSE; # if array value is not find the set it to FALSE
}
if($found == FALSE) continue; # move on to next filename with displaying
echo $filename; # display the found filename
Haha aw, thanks! Main thing I need right now is a good design and a good chunk of time to implement it, but thanks for trying to help with the implementation!
Hi! I've uploaded a new version that should make this possible with regexes.
(In fact, it was already almost possible, but it was broken due to a bug.)
To search for
John
ANDSmith
, you can now use(?=...)
as follows:You can also add more terms by inserting additional similar
(?=...)
clauses.It will be slower than a normal search, but hopefully it will still be usable.
Last edit: - 2018-05-07
Yes, that looks like a very simple and intuitive syntax indeed. Just meaning AND.
I never claimed it was easy or intuitive. I was just trying to help you find a way to do this, otherwise you wouldn't be able to do this at all.