Skip to content

Commit 9936c21

Browse files
committed
Documents: Update search queries and filter documentation photoprism#4600
Signed-off-by: Michael Mayer <michael@photoprism.app>
1 parent f747211 commit 9936c21

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

internal/entity/search/photos_geo.go

+7-1
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,12 @@ func UserPhotosGeo(frm form.SearchPhotosGeo, sess *entity.Session) (results GeoR
250250
case terms["video"]:
251251
frm.Query = strings.ReplaceAll(frm.Query, "video", "")
252252
frm.Video = true
253+
case terms["documents"]:
254+
frm.Query = strings.ReplaceAll(frm.Query, "documents", "")
255+
frm.Document = true
256+
case terms["document"]:
257+
frm.Query = strings.ReplaceAll(frm.Query, "document", "")
258+
frm.Document = true
253259
case terms["vectors"]:
254260
frm.Query = strings.ReplaceAll(frm.Query, "vectors", "")
255261
frm.Vector = true
@@ -535,7 +541,7 @@ func UserPhotosGeo(frm form.SearchPhotosGeo, sess *entity.Session) (results GeoR
535541
} else if frm.Video {
536542
s = s.Where("photos.photo_type = ?", media.Video)
537543
} else if frm.Photo {
538-
s = s.Where("photos.photo_type IN ('image','raw','live','animated')")
544+
s = s.Where("photos.photo_type IN ('image','raw','live','animated','vector')")
539545
}
540546

541547
// Filter by storage path.

internal/form/search_photos.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ type SearchPhotos struct {
3333
Live bool `form:"live" notes:"Finds Live Photos and short videos"`
3434
Vector bool `form:"vector" notes:"Finds vector graphics only"`
3535
Video bool `form:"video" notes:"Finds videos only"`
36-
Photo bool `form:"photo" notes:"Excludes videos from search results"`
36+
Photo bool `form:"photo" notes:"Excludes videos and documents from search results"`
3737
Scan string `form:"scan" example:"scan:true scan:false" notes:"Finds scanned photos and documents"`
3838
Mp string `form:"mp" example:"mp:3-6" notes:"Resolution in Megapixels (MP)"`
3939
Panorama bool `form:"panorama" notes:"Finds pictures with an aspect ratio > 1.9:1"`

internal/form/search_photos_geo.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ type SearchPhotosGeo struct {
3434
Live bool `form:"live" notes:"Finds Live Photos and short videos"`
3535
Vector bool `form:"vector" notes:"Finds vector graphics only"`
3636
Video bool `form:"video" notes:"Finds videos only"`
37-
Photo bool `form:"photo" notes:"Excludes videos from search results"`
37+
Photo bool `form:"photo" notes:"Excludes videos and documents from search results"`
3838
Scan string `form:"scan" example:"scan:true scan:false" notes:"Finds scanned photos and documents"`
3939
Mp string `form:"mp" example:"mp:3-6" notes:"Resolution in Megapixels (MP)"`
4040
Panorama bool `form:"panorama"`

0 commit comments

Comments
 (0)