Member
Member
Douten   2009-04-18, 01:37
#1

I read in the comment of template-function of getSearchWords() that "If tokens are separated by spaces, the OR function is presumed." That means putting space will be the same as , and | correct?
If that's not what it meant, how do I make it so when there's a space in the search field it's recognized as , and |
Like for this picture I tagged it as Tom, Smith and the title is Tom Smith. But when I type in "Smith Tom" it didn't show result, but if I do Smith, Tom it shows.
I know a little bit of php so I'll try to mess my way around in the mean time.

Thanks for any help!
Douten

Member
Member
sbillard   2009-04-18, 02:50
#2

You have read the comment correctly. Unfortunately, it is not correct. Comma or | is required to get the OR function. Strings not separated by an operator are considered one term.

Member
Member
Douten   2009-04-18, 03:45
#3

Oh I get it. Tokens are like !, |, etc. so if it's "name & name" it'll be read as "name-or-and-or-name" right?
Is there a way I can split the string at space characters so they can be read as two string? Like is I type "Smith Tim" the search will read it as "Smith|Tim".

This will require learning on my part right? I'll go look at some php tutorials.

Member
Member
sbillard   2009-04-18, 15:37
#4

The tokens are ! & | , ( ) You can also use NOT AND OR inplace of the !, & and | tokens. , is the same as |. Parens are used for grouping. ! is unary. Space is part of the token. You can also place strings in quotations so that you can search on the string `"TOM & Jane" for an match of the full string.

As I said, the document you found was not correct. Space is NOT the same as OR.

Member
Member
Douten   2009-04-18, 15:44
#5

Okay, I think I've got an understanding of how the token works. How would I change it so that space is read as an OR token though? so a search of "Smith Tim" would show "Tim Smith" image up (if I have Tim, Smith for tags of the "Tim Smith" image).

Thanks~ : )

Member
Member
sbillard   2009-04-18, 15:58
#6

You would have to modify the zenphoto core class-search.php file. Not a recommended tactic.

Member
Member
Douten   2009-04-18, 17:14
#7

I see. I guess I'll just let the user know about the search tokens then~ Thanks : )

Member
Member
RachelL   2009-04-18, 23:47
#8

If anyone does try to modify the class-search file to make this happen it would be beyond amazing, this is a big problem for what I use Zenphoto for as my users are not patient enough to read an explanation on how to search for things

Member
Member
sbillard   2009-04-19, 02:58
#9

Please give tonight's nightly build a try. There is now an option to treat spaces as the OR operator.

Member
Member
RachelL   2009-05-01, 05:45
#10

Thank you for that sbillard, can't wait to try it out.

-Rachel

  
Powered By MyBB, © 2002-2026 MyBB Group.
Made with by Curves UI.