How is the search function suposed to work?
danjoh
![]()
Joined: 2009-01-17
Posts: 21 |
![]() |
I am back playing with G3 and I can not get the search function to work. Regards, |
|
nivekiam
![]()
Joined: 2002-12-10
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. |
|
bharat
![]()
Joined: 2002-05-21
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. |
|
danjoh
![]()
Joined: 2009-01-17
Posts: 21 |
![]() |
Great, I'll try in a few days and come back with the result. |
|
danjoh
![]()
Joined: 2009-01-17
Posts: 21 |
![]() |
Today I finally got around to upgrade to the latest nightly release (gallery-gallery3-7ad0808a117fd1db4e94da8d7763ccca1d69350a.zip). mysql> select * from search_records where data like '%Per%'; +----+---------+-------+----------------------------+ | id | item_id | dirty | data | +----+---------+-------+----------------------------+ | 28 | 28 | 0 | dsc02756.jpg dsc02756 Per | +----+---------+-------+----------------------------+ 1 row in set (0.02 sec)
But when I do a search (Per or per) it still does not show. |
|
danjoh
![]()
Joined: 2009-01-17
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. -- |
|
bharat
![]()
Joined: 2002-05-21
Posts: 7994 |
![]() |
1) http://sourceforge.net/apps/trac/gallery/ticket/617 -- good catch! --- |
|
danjoh
![]()
Joined: 2009-01-17
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: And here is my workaround: ft_min_word_len=2 ft_stopword_file='' And rebuild the search_records table mysql> REPAIR TABLE search_records QUICK; +-----------------------+--------+----------+----------+ | Table | Op | Msg_type | Msg_text | +-----------------------+--------+----------+----------+ | dev_g3.search_records | repair | status | OK | +-----------------------+--------+----------+----------+ 1 row in set (0.00 sec) Now I can search for "Per" and it gets found. mysql> SELECT * FROM search_records WHERE MATCH(search_records.data) AGAINST ('per' IN BOOLEAN MODE); +----+---------+-------+----------------------------+ | id | item_id | dirty | data | +----+---------+-------+----------------------------+ | 28 | 28 | 0 | dsc02756.jpg dsc02756 Per | +----+---------+-------+----------------------------+ 1 row in set (0.00 sec) 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. -- |
|
chivocrespo
Joined: 2010-11-02
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 |
|
danjoh
![]()
Joined: 2009-01-17
Posts: 21 |
![]() |
On my box its in /etc/mysql/my.cnf in the [mysqld] section. # grep "\[mysqld\]" -A 2 my.cnf [mysqld] ft_min_word_len=2 ft_stopword_file='' -- |
|
floridave
![]()
Joined: 2003-12-22
Posts: 27300 |
![]() |
There is now a module: |
|