Search…

X3 Photo Gallery Support Forums

Search…
 
User avatar
Joseph_balson
Experienced
Topic Author
Posts: 73
Joined: 08 Mar 2021, 05:35

I got: working keywords, search and smart search

17 Jun 2021, 19:29

While the X3 dev is working on a sitemap function for my website, I've been working on implementing a very basic, quick and dirty keyword and search feature.
I didn't code for the Web since 2010 and trying to figure out what another (good) coder has been doing is not easy. Therefore, what I did is really far from perfect and more like a proof of concept: it can be done.
The thing is it works only with my Lightroom workflow, but it works.
The photos have the IPTC keywords displayed, you can click on a keyword and it will load a page with all the photos with that keyword. Not super pretty but it works.

https://www.joseph-balson.com/Search-a-photo/
Last edited by Joseph_balson on 21 Jun 2021, 19:46, edited 1 time in total.
 
User avatar
mjau-mjau
X3 Wizard
Posts: 13993
Joined: 30 Sep 2006, 03:37

Re: Working keywords and search

18 Jun 2021, 01:29

Wow nice work!
 
User avatar
Joseph_balson
Experienced
Topic Author
Posts: 73
Joined: 08 Mar 2021, 05:35

Re: Working keywords and search

18 Jun 2021, 06:36

Thanks.

I made the search function a little more useful: it can take more than one keyword. The basis is AND: it will return the photos with ALL the keywords in the search field.

The popup is now working quite correctly in the search results and list of images for a specific keyword.
 
User avatar
Joseph_balson
Experienced
Topic Author
Posts: 73
Joined: 08 Mar 2021, 05:35

Re: Working keywords and search

19 Jun 2021, 05:11

EDITED.

https://www.joseph-balson.com/Search-a-photo/

I finally understood how X3 displays an album.
Now, the search results page and the keywords page are consistent with the look and feel of a normal X3 album page.
The search takes keywords and description into account.

I'm now considering if it would be a bad or good idea to cache these pages.
I finally decided to not cache these pages. It's really cumbersome, it takes quite a lot of space, and is not really useful in the end.

It's actually pretty fast and smooth considering I'm not using any database and there are more or less 4300 photos and 1300 keywords there.

Displaying Keywords: My X3 displays lightroom keywords (IPTC keywords) in the image popup and the web page for an individual image.
Clicking on a keyword opens a page showing all the photos with that keyword present in the IPTC keywords or IPTC description.
That page has all the bells and whistles and responsiveness of a regular X3 album page. All the layouts and effects work. 

Search function: The same function and results page are used for the search function. It will display all the photos with all the keywords present in IPTC keywords and description.
There are two options: exact match, or partial match. Not sure what is best, so there is an option, the user can decide with e checkbox.
- partial: search for : cat will show photos with keyword cat, but also cats, caterpillar or Catherine.
- exact: search for cat will show only photos with keyword cat.

Managing the keywords: I coded these functions for my personal use. I'm managing my photos albums in Lightroom, taking advantage of keywords management (especially nested keywords), IPTC functions, etc. I NEVER do any photo management in the X3 panel, and I don't use the JSON files to store anything related to individual photos. 

Installing it on any X3 is possible, but that requires some coding and some discipline in the way of managing X3 folders organisation: I really tailored it for my personal use and needs, meaning it would likely not fit anyone else's needs, especially someone not using Lightroom to manages the photos in X3.

updates:
- some url rewrite made all that a little more pretty. With some very minor adjustments in the htaccess it could also be used to create virtual albums based on keywords directly in the X3 panel.
 
User avatar
Joseph_balson
Experienced
Topic Author
Posts: 73
Joined: 08 Mar 2021, 05:35

Re: Working keywords and search

21 Jun 2021, 19:33

it's also possible to code some sort of smart search. The test page isn't pretty but it works.

https://www.joseph-balson.com/Search-a-photo/
Last edited by Joseph_balson on 22 Jun 2021, 08:15, edited 1 time in total.
 
User avatar
mjau-mjau
X3 Wizard
Posts: 13993
Joined: 30 Sep 2006, 03:37

Re: I got: working keywords, search and smart search

22 Jun 2021, 00:33

Thanks again for keeping us updated  :clap:
 
metallissimus
Experienced
Posts: 331
Joined: 17 Oct 2019, 06:54

Re: I got: working keywords, search and smart search

22 Jun 2021, 02:02

Wow, this is amazing! I personally have no use for this (so far), but I believe there are some X3 users who would absolutely love to have this functionality.
www.danielbollinger.de – corporate photography
hochzeiten.danielbollinger.de – wedding photography
 
User avatar
Joseph_balson
Experienced
Topic Author
Posts: 73
Joined: 08 Mar 2021, 05:35

Re: I got: working keywords, search and smart search

22 Jun 2021, 15:21

Trying to polish the thing. I don't have the artistic talent to make something as pretty as X3, but I try.

Link sharing of search results pages works correctly now.
 
User avatar
Joseph_balson
Experienced
Topic Author
Posts: 73
Joined: 08 Mar 2021, 05:35

Re: I got: working keywords, search and smart search

22 Jun 2021, 22:46

This mod definitely allows to create some basic virtual galleries based on keyword.
On my website, with my parameters, I just have to create a folder named "virtual" (could be anything) , and in that folder, create any folder name d "keywoord1_keyword2_ 3 4 etc..."

there are some things to adjust like the fact the mega menu doesn't work properly (yet), or the base page "virtual" should be modded to display the child virtual folders, and mostly other cosmetic issues.
Those pages can be cached, shared, and behave exactly like any other folder.

could be something like that: 
https://www.joseph-balson.com/virtual/clouds_sun
https://www.joseph-balson.com/virtual/boat_lake
https://www.joseph-balson.com/virtual/b ... water_drop
 
User avatar
Joseph_balson
Experienced
Topic Author
Posts: 73
Joined: 08 Mar 2021, 05:35

Re: I got: working keywords, search and smart search

26 Jun 2021, 07:17

a page for the search form was not good.
In the panel, I hijacked the settings and menu: settings->menu->drop down option and added a "smart search" option.

In normal display mode, the search form shows in the menu and the link to that page with the form is hidden.. Best practice to me would seem to put that at the end of the menu.

In mobile mode or small window, the search form is hidden, replaced by the link to the page with the form: I could not find a way to modify x3.min.js to keep the menu panel open after clicking on a suggestion. The code in unreadable even after being prettyfied. That would be the best option, so I'll keep looking into it.

demo is here: https://www.did-art.fr/
 
User avatar
Joseph_balson
Experienced
Topic Author
Posts: 73
Joined: 08 Mar 2021, 05:35

Re: I got: working keywords, search and smart search

28 Jun 2021, 17:18

made some progress.
All my mods are now faster and broader.
Search now picks up in the photo exifs keywords, title and description, and also in regular pages content.
the virtual albums work well, but it's a just a little bit cumbersome to setup in the panel.

Also, search results and virtual albums are cached. I decided it makes sense, and storage is so cheap anyways. 
 
User avatar
mjau-mjau
X3 Wizard
Posts: 13993
Joined: 30 Sep 2006, 03:37

Re: I got: working keywords, search and smart search

31 Aug 2023, 05:42

I know this is an old post, but I have an update coming in regards to Google Images Sitemap in X3, please read:
viewtopic.php?f=51&t=10650&p=49984