I am back playing with G3 and I can not get the search function to work.
I have put a keyword into the description field and as a tag but I am still not able to search for it.
The only search I gotten to work is if I search for an exact Title or exact Filename.
Is this the expected behavior or should I be able to search for parts of the Title/Description/Filename/Tags?
(In G2 I can search for my Keywords - which I use extensively)
Regards,
--Dan
Posts: 16504
I think, (I hope really) that there is still work to be done on that. For example, I have a photo title Fred_03. Searching for Fred, finds nothing. But searching for Fred_03 will find the photo.
____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here
Posts: 7994
It should find words that you put into your description, and if you get the latest code and rebuild your search index (in mysql, do "truncate search_records" then go to Admin > Maintenance) then it'll index tags too.
---
Problems? Check gallery3/var/logs
bugs/feature req's | upgrade to the latest code | use git | help! vote!
Posts: 21
Great, I'll try in a few days and come back with the result.
--
Dan
Posts: 21
Today I finally got around to upgrade to the latest nightly release (gallery-gallery3-7ad0808a117fd1db4e94da8d7763ccca1d69350a.zip).
I can now see in the search_records table that the Tag entry is there:
But when I do a search (Per or per) it still does not show.
--
Dan
Posts: 21
I have been playing a little bit more and found the following:
1) If I add a Tag to a photo using the "Edit this photo", the search_records table does not get updated.
2) A bit more troublesome is that the search for "Per" in my last post does not fail due to a bug or such in G3 - it is mysql's MATCH ... AGAINST construct that "filers" this. If I set the Tag to "Robert" it get found as it should. The problem for me is that I planned to use the Tag function to record the name of the persons in the photo and in Swedish we have a lot names the are short (like Dan, Per, ...).
--
Dan
Posts: 7994
1) http://sourceforge.net/apps/trac/gallery/ticket/617 -- good catch!
2) http://sourceforge.net/apps/trac/gallery/ticket/618 -- this will be harder to fix. I have no ideas about that currently.
---
Problems? Check gallery3/var/logs
bugs/feature req's | upgrade to the latest code | use git | help! vote!
Posts: 21
For (2) I have found the reason for not finding the text and a dirty workaround.
The reason for not finding "Per" is twofold:
a) The default min length in mysql for search words are 4 chars.
b) The word "per" is in the default "Stop-Word-File" (mysql source file: storage/myisam/ft_static.c) and will not be considered in the search.
And here is my workaround:
In the mysql configuration file I had to add the following two lines to the [mysqld] section.
And rebuild the search_records table
Now I can search for "Per" and it gets found.
The big drawback with this approach is that this effects the whole mysql-server, so if you have other DB's in the same server where you use the fulltext search its behavior gets changed as well.
--
Dan
Posts: 44
Sorry, but I can't find were in the mysql to add the two lines that allow the search with less than 4 characters. Can someone explain me with more detail? Please
Posts: 21
On my box its in /etc/mysql/my.cnf in the [mysqld] section.
Like This:
--
Dan
Posts: 27300
There is now a module:
http://codex.gallery2.org/Gallery3:Modules:short_search_fix