Search documentation

Is there some documentation on search that I'm not finding?

I noted from things the web GUI stuck into the search box briefly that parens and the words AND and OR might do something special in the search (looks like boolean search maybe). By experimenting, I found that the string "Ihinger AND Rob" found different photos from what the string "Ihinger Rob" (and the AND form found what you'd expect in a boolean search, even). And I can create a dynamic album from that search, too.

But now I'm curious about details of search string syntax. Where should I be looking? Searches in the user guide have not been productive so far.

Comments

  • Searches are basically boolean expressions on database fields. There are some options (see the search options page) which define some specific behavior--for instance how a space in the search string is treated and what database fields are allowed.

    So start by understanding the search options.

    For instance, to satisfy your other post need you could have a search that searches the filename field for each album you want included in the result. e.g.

    Album1 OR Album2/subalbum1 OR ....

  • dd-b Member

    So each word (that isn't AND or OR) is compared for equality to all of the database fields enabled?

    Is there any way to specify the comparison operator, or to compare a value against one database field, and another value against a different database field? Can I look for Keyword >= "Minicon 40" , or do City == "New York" AND Country == "USA"?

  • So each word (that isn't AND or OR) is compared for equality to all of the database fields enabled?

    Yes, that is the way it works. (BTW, "NOT" is also in that list!)

    Sorry, only the == comparison. Not sure how much sense relational operators would make anyway for string comparisons. Anything starting with "M" or later in the alphabet would match >= "Minicon 40"

    Also, you cannot specify the field other than through the search options, so

    City == "New York" AND Country == "USA"

    would be written "New York" AND "USA" (the quotes around USA are redundant) and would match these targets to both the City and the Country field. In this case that is probably not an issue.

  • dd-b Member

    Yep, I see how equality to any word is likely to work out right surprisingly often in real-world metadata, at least that example. I think about searches like a programmer (which is what I was for 50 years), but for use by site visitors, modest numbers of false positives are quite harmless.

    I can show a case where that string >= does make some sense, but a more obvious case is date >=, which is equally impossible. Mostly I picked a bad example :-) .

    NOT is good, glad it's there!

    There isn't a good writeup anywhere we haven't mentioned, is there? Especially there should probably be something on the actual gallery pages (on deployed sites I mean) to suggest to users that search doesn't work quite the way they're used to, and point them to some info to get them started.

  • acrylian Administrator, Developer
    edited September 1

    No, there is no actual documentation on this. You can also use quotes for fixed therms. Also review the search options as they also affects results.
    I assume most users willl surely just type a word and hit apply ;-)

  • dd-b Member
    edited September 1

    I'm sure that's exactly what most users will do.

    The gallery I'm working on is historic photos of science fiction fandom, centered on where I live in Minneapolis in Minnesota, covering 50 years so far and half a dozen photographers (two big collections are the core currently). I'm looking to serve both our current members who remember those years and like to see old pictures, and some researchers looking to flesh out books and articles (fandom itself is of some interest these days, plus between residents and guests brought in to conventions, we've had a lot of the top authors around and photographed). I suspect somewhat sophisticated searching is going to be important for the second part of this, if it's going to happen. Also things like "can we find both these people in a picture" (I sold a picture from my personal collection to Julie Phillips for her book on Alice Sheldon / James Tiptree Jr. because it had Lester del Rey and his wife Judy Lynn del Rey in a single photo).

    Plus it matters for dynamic albums, where I get to spend time to figure out how to do complicated selections, if I want.

    (If I end up doing this in Zenphoto, and hence spending time becoming much more expert in searching, maybe I'll manage to write something that can be made available.)

  • sbillard Member
    edited September 15

    Of course what you can find in a search mostly depends on what is stored in the metadata accompanying the image. Assuming you have noted both people in the description (and of course you have enabled pattern matching and the description in the search options) a search of "Lester del Rey" & "Judy Lynn del Rey" would find the images.

    If you implemented a search that used the field names and programmatic relationships --e.g. description contains name then the visitor would have to know a lot more about the software organization. He would have to know that there was a description (or whatever) and that it was there that the names would be found. And he would have to know how to write the quest.

    The zenphoto search was meant to meet basic needs for basic users.

  • acrylian Administrator, Developer

    Also users can enable and disable search fields to search in specific ones (there a button next to the input field usually).

    Also using tags is the easiest as you then also can enable the tag_suggest plugin to make suggestions to help find things.

Sign In or Register to comment.