Hello,
I am building a simple photo gallery for a client. A large part of this is a good search engine for the photos... do display photos by Theme, Artist, Style and the like. I would like some advice on the best way to structure / search this website.
Each photo can be categorised in a many ways, it may be Black & White (a Style), a Portrait (again a Style), by the Artist Alberto (Artist) and also be in Feel Good (a Theme).
In order to do this I have spent some time designing a database that handles these functions in a fast, user-friendly manner. Record names have been exagerated for simplicity here.
Photo DB is:
photo_id
photo_artist_id
photo_name
photo_src
There is a corresponding Artist DB with id, name that can be referenced from this photo (or more likely, Photos from the Artist). I feel this structure is quite sound, and am happy with it.
What I would like to know is if I am handling my Themes and Styles databases well.
I will give the Theme DB as an example, there are two DB's for each Theme:
THEME DB:
theme_id
theme_name
which might consist of:
theme_id: 1
theme_name: Feeling Good
Then a second DB that matches a Photo to a Theme:
THEME_PHOTOS DB:
theme_id
photo_id
This way I can easily match a photo to a theme, or several themes.
First question: is this a good way of structuring my db?
Second question: what is the best way to search all of my themes, artists and styles for a keyword?
What I started doing was a search for the keyword in THEME db, then matching that with photo id etc. However should I lump this search with the ARTIST and STYLE search in one big array, or is it better to search each DB, send results, search next DB?
Thank you for your time to read this long message, I appreciate any advice you could give me.
Cheers,
Yari