paolobenve / myphotoshare

MOVED TO GITLAB! --- A Web 2.0 Photo Gallery Done Right via Static JSON, Dynamic Javascript and a bit of php for sharing
15 stars 0 forks source link

search feature #72

Closed paolobenve closed 6 years ago

paolobenve commented 6 years ago

Thinking on how to implement a search feature: we need a search virtual folders system, the 3rd virtual folders system after date and gps ones: the folders correspond to the words to search

In the scanner:

In js:

pmetras commented 6 years ago

Can't the search be done entirely on the JavaScript side?

Or at least it depends on the type of search you want to have:

paolobenve commented 6 years ago

it seems to me that a free word search in js would requiere to read all the physical folders json files... It looks too time consuming with my 35,000 media and 1300 folders...

paolobenve commented 6 years ago

I'm almost ready!!!

paolobenve commented 6 years ago

it's in master, working for albums and media,

The implementation works with words taken from media/album name, title, description, tags, removing punctuation and numbers

Permits whole word and inside words search, considering accents and capitals or not

To do: when clicking on a search album, the normal album is opened, while it should remain on search mode

paolobenve commented 6 years ago

@pmetras can you give it a try?

pmetras commented 6 years ago

This is really great! I don't know of any other static gallery with these features!!!

I corrected a small bug and it's working very well now on my small test gallery. I have to continue indexing my photos and adding metadata to see how it scales. Now the scanner creates a lot of index files in the cache folder. Will we encounter any OS/directory limit that will require sharding like for the picture files?

I can add support for stop words. Many words must not be indexed because there are too frequent and don't bring meaning like pronoun, articles, propositions, etc. We can use public lists like https://github.com/stopwords-iso. It'll reduce the number of index files created.

pmetras commented 6 years ago

Another interesting search feature but I don't know if it can be done easily is search with logical AND. Looking for media were word1 AND word2 are both present. This is useful when you have photos with too many items in the result sets for word1 or word2 to browse them, but where the intersection is small and can be browsed.

paolobenve commented 6 years ago

Another interesting search feature but I don't know if it can be done easily is search with logical AND. Looking for media were word1 AND word2 are both present. This is useful when you have photos with too many items in the result sets for word1 or word2 to browse them, but where the intersection is small and can be browsed.

after making a search, the "any word" option is showed: selecting/unselecting it makes OR/AND search

paolobenve commented 6 years ago

@pmetras get current master code, a bug prevented treewalker from finishing, json files were not updated and thumbnails were always regenerated

paolobenve commented 6 years ago

it's ok! :-)