How to search for numerical keywords?

I take photos at sports events (in my case, motocross) and embed the
numbers of the competitors as specific keywords in the IPTC headers.
SM parses these correctly, I see the numerical keywords for each photo.
However I can't search for the photos by numerical keyword. The problem
is doubly frustrating in that searching for a small number (like "5") doesn't
work at all because the "search string is too short" - arrrgh.
If I only have a few numbers, it's not a huge deal because the top 100
keywords will show the numbers. But after I have hundreds of numbers in
the system it doesn't scale.
I tag each photo with keywords for bike brand and number (for example,
"honda" and "38"). I'd like to let my users just enter "honda 38" in the
search box and just get photos matching both. But that doesn't work (it
returns all photos matching "honda" and "38" is ignored).
Help?
numbers of the competitors as specific keywords in the IPTC headers.
SM parses these correctly, I see the numerical keywords for each photo.
However I can't search for the photos by numerical keyword. The problem
is doubly frustrating in that searching for a small number (like "5") doesn't
work at all because the "search string is too short" - arrrgh.
If I only have a few numbers, it's not a huge deal because the top 100
keywords will show the numbers. But after I have hundreds of numbers in
the system it doesn't scale.
I tag each photo with keywords for bike brand and number (for example,
"honda" and "38"). I'd like to let my users just enter "honda 38" in the
search box and just get photos matching both. But that doesn't work (it
returns all photos matching "honda" and "38" is ignored).
Help?
0
Comments
Please see my pro tips thread
http://www.dgrin.com/showthread.php?t=20236
http://www.dgrin.com/showpost.php?p=201560&postcount=28
http://www.koalaplayhouse.com/gallery/906894
Portfolio • Workshops • Facebook • Twitter
Figured out a better way, using javascript and the /keyword/<key>-<key>-<key>... url syntax. See:
http://jcmx.smugmug.com
For those who might have a tough time deciphering which JS I added, here
it is:
<!--
function doTheSearch()
{
var n = document.bikesearch.number.value;
var b = document.bikesearch.brand.options[document.bikesearch.brand.selectedIndex].value;
if ( n=="" && b=="" ) {
return;
}
var newUrl = "/keyword/";
if ( n!="" && b!="" ) {
newUrl += n + "-" + b;
}
else if ( n=="" ) {
newUrl += b;
}
else {
newUrl += n;
}
window.location = newUrl;
}
// -->
and the appropriate HTML (tables are for nice formatting):
<table border=1><tr><td>
<form name="bikesearch" action="">
<table border=0><tr><td valign=middle>
<font color=white size=-1 face=arial>Enter your bike number: </td><td valign=middle><input name=number size=3> </td><td valign=middle><font color=white size=-1 face=arial>Brand: <select name=brand>
<option value="">
<option value="honda">Honda
<option value="yamaha">Yamaha
<option value="kawasaki">Kawasaki
<option value="suzuki">Suzuki
<option value="ktm">KTM
<option value="cobra">Cobra
<option value="polini">Polini
<option value="lem">LEM
</select> </td>
<td valign=middle><input type="button" name=search value="Search" onClick="doTheSearch()"></td></tr></table>
</td></tr></table></form>
Thanks,
John
Can we have a gallery link where this is being used? I'd love to see it in action!
Portfolio • Workshops • Facebook • Twitter
working that sort of thing in more as I get it ramped up (have lots of photos
to move over from my old site).
http://www.dgrin.com/showthread.php?p=343358#post343358
Portfolio • Workshops • Facebook • Twitter
I just tried the html from within a gallery description and it works like a charm.
I could see using this for my baseball/volleyball pictures (player/game instead of brand/number).
tristansphotography.com (motorsports)
Canon 20D | 10-22 | 17-85 IS | 50/1.4 | 70-300 IS | 100/2.8 macro
Sony F717 | Hoya R72
tristansphotography.com (motorsports)
Canon 20D | 10-22 | 17-85 IS | 50/1.4 | 70-300 IS | 100/2.8 macro
Sony F717 | Hoya R72
Post your html for the drop-downs and I'll respond with a mod.
John
tristansphotography.com (motorsports)
Canon 20D | 10-22 | 17-85 IS | 50/1.4 | 70-300 IS | 100/2.8 macro
Sony F717 | Hoya R72
Class:
SA
SF
SR
MA
MR
UA
UR
Make:
Acura
Audi
BMW
Chevy
Ford
Honda
Mitsubishi
Mazda
Nissan
Porsche
Subaru
Toyota
Color:
Black
Blue
Gray
Orange
Red
Silver
Yellow
White
tristansphotography.com (motorsports)
Canon 20D | 10-22 | 17-85 IS | 50/1.4 | 70-300 IS | 100/2.8 macro
Sony F717 | Hoya R72
I've implemented the search on my site, but the same behavior happens. I tried added onSubmit to the form, but that didn't accomplish anything...
Thank you
First off, I'd like to thank JCMX for the coding he supplies and the guys at SmugMug that have been helping me via email...THANKS
Hello. I too installed the java script from JCMX on my gallery for my bike pictures. From what I can see, it should work for 4-digit numbers without making any changes. I tried it before making what I thought would be the change in the script (where is says "input name=number size=3>" I tried changing the number to 4) and it still worked so I think it will work just fine like it originally is.
I'm having trouble with my single and double digit number keywords that I'm putting on my photos. I'm seeing that, on my homepage, all my single & double digit keywords ar enot showing. I'm also seeing that they are not showing up in the galleries. When I go back to the SmugMug program to add them in, I see that they are there. I understand the SmugMug search program right now doesn't allow for single and double digit searches on keywords. I'm using the java script from JCMX, which was working great. I know it's not his java script because of the issue I'm seeing with my homepage keyword section not listing any single & double digit keywords (at one time I saw some single & double digits but not all, then all of a sudden they were all gone). I take LOTS of pictures and have spent LOTS of time and energy in getting my pictures keyworded with these numbers so riders can find themselve quickly. Don't know if this wil work, but here is a link to one of my galleries that has single & double digit keywords. If you look at the picture of these riders, the keyword doesn't appear (which explains why it doesn't show on my homepage), but if you "edit" the keyword or go into the SmugMug program to add keywords, you will see them there. If you can't see this and there is a regular email address I can use, I'd be more then happy to try and send a screen shot of what I'm talking about.
<!--
function doTheSearch()
{
var n = document.bikesearch.number.value;
var b = document.bikesearch.brand.options[document.bikesearch.brand.selectedIndex].value;
if ( n=="" && b=="" ) {
return;
}
var newUrl = "/keyword/";
if ( n!="" && b!="" ) {
newUrl += n + "/" + b;
}
else if ( n=="" ) {
newUrl += b;
}
else {
newUrl += n;
}
window.location = newUrl;
}
// -->
Cheers,
David
SmugMug API Developer
My Photos
Tristan,
Your site looks great, I looking to do a search box like what you've done, but only in one gallery, "Events" what I envision would be that when the Events gallery is picked then the search box would be displayed, with the option to also view all photos, Any ideas?
http://stillriversphotography.com
David...I'm thinking it has nothing to do with the java script because they are missing from the actual keyword section on my homepage and are "missing" from the photos as well (however, they do show up when I go back into the smugmug program for adding keywords). I'm trying to figure out how I can get screen shots made into JPEGS so I can post them for you and others to see so you know what I'm talking about.
David...try these. I've attached 3 PDFs that hopefully you can open: "homepage" pdf is what is shown on my SmuMug homepage, "gallery_62 missing" pdf is what it looks like looking at one of my pictures in it's gallery, "gallery_62 listed" pdf is what you see when you click on the "edit" button to edit the keywords (hopefully the attachments posted <img src="https://us.v-cdn.net/6029383/emoji/ne_nau.gif" border="0" alt="" > )
Great job, I'm looking to do a search box like this one, but to show up in only in a few selected galleries and the home page Any ideas?
http://stillriversphotography.com
Just to give you an alternative solution, all the galleries under http://www.marignatios.com/Esportes allow searching using race numbers. The way we've solved it there is that each gallery has its own keyword, which we mass-add to all pictures at once. We rig the search box there with JS to concatenate the gallery keyword with the number, creating a /keyword/ URL.
For numbers with a single digit we always prefix it in the photo with 0, so there's no "5", just "05", and the search box JS prefixes the number with a zero if it's just one digit.
Question: do you add the IPTC keyword manually, or do you use some form of OCR on the picture?
I think you're saying you use some third-party program to add keywords to pictures. Note that SM expects keywords to be under the IPTC:Keywords field: http://www.smugmug.com/help/keywords-tags -- maybe your program is adding them to some other field and they aren't getting recognized. You can tell by looking at the picture in the gallery -- when SM recognizes the keywords they are listed under the picture.