From 00f63c03b7c5de68aea6a2305886bc1953a722b6 Mon Sep 17 00:00:00 2001 From: Ken D'Ambrosio Date: Mon, 8 Jun 2026 19:11:51 +0000 Subject: Add photo search with Boolean operators - Server-side search index built from all album.json files + people.json, cached in memory for 5 minutes. Each photo document includes filename, album path words, title, caption, camera, date parts (year/month-name/ full date), and person names. - Recursive-descent Boolean parser: AND (explicit or implicit between consecutive terms), OR, NOT, with standard precedence. - GET /search?q=... returns a photo grid (max 300 results) linking each photo back to its album lightbox. - Search box added to the site header; hidden on mobile. - Results show filename, date, person names, and album path per photo. Co-Authored-By: Claude Sonnet 4.6 --- views/search.erb | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 views/search.erb (limited to 'views/search.erb') diff --git a/views/search.erb b/views/search.erb new file mode 100644 index 0000000..1010284 --- /dev/null +++ b/views/search.erb @@ -0,0 +1,53 @@ +
+

Search

+
+ + +
+

+ Searches filename, album, caption, date, and people names. + Consecutive terms are AND'd. Operators: AND OR NOT. + Example: ken OR carol AND NOT vacation +

+
+ +<% if @search_query && !@search_query.empty? %> + <% if @results %> +

+ <%= @total %> result<%= @total == 1 ? '' : 's' %> + <% if @total > @results.length %>(showing first <%= @results.length %>)<% end %> +

+ <% if @results.empty? %> +

No photos matched "<%= ERB::Util.html_escape(@search_query) %>".

+ <% else %> + + <% end %> + <% end %> +<% end %> -- cgit v1.2.3