GRS db
I now have an editor editing, admin checks checking and other stuff stuffing. Next on the agenda is to optimize the SQL and build a range query for editors working on blocks of slides, like accession ID 12345-13345. Ideally, one would search for that very thing (12345-13345) and be able to bookmark it, or where they left off in it.
As for the SQL optimization, I am currently using a query like this:
SELECT *, MATCH
(slide_id, accessionID, country_name, photographer_name,
site_name, type_name, period, location_name,
keywords, notes, title, view)
AGAINST ("cave" IN BOOLEAN MODE)
AS relevancy FROM data_view
WHERE MATCH
(slide_id, accessionID, country_name,
photographer_name, site_name,
type_name, period, location_name,
keywords, notes, title, view)
AGAINST ("cave" IN BOOLEAN MODE)
AND has_img IS NOT NULL
ORDER BY relevancy DESC
Which brings back 37 hits in ~0.87 seconds. I'm using BOOLEAN MODE because it is the FULLTEXT search mechanism in MySQL.
The question is, is boolean mode worth using? If I do the search this way:
SELECT * FROM `data_view`
WHERE (
`slide_id` LIKE '%cave%'
OR `accessionID` LIKE '%cave%'
OR `period` LIKE '%cave%'
OR `definer` LIKE '%cave%'
OR `has_img` LIKE '%cave%'
OR `keywords` LIKE '%cave%'
OR `old_location` LIKE '%cave%'
OR `date_modified` LIKE '%cave%'
OR `date_accessed` LIKE '%cave%'
OR `accessed_from_URL` LIKE '%cave%'
OR `ownership` LIKE '%cave%'
OR `notes` LIKE '%cave%'
OR `title` LIKE '%cave%'
OR `view` LIKE '%cave%'
OR `country_name` LIKE '%cave%'
OR `country_code` LIKE '%cave%'
OR `location_name` LIKE '%cave%'
OR `photographer_name` LIKE '%cave%'
OR `site_name` LIKE '%cave%'
OR `type_name` LIKE '%cave%'
OR `type_code` LIKE '%cave%'
) AND has_img IS NOT NULL ORDER BY accessionID DESC
I get 52 hits in ~0.46 seconds. The 15 extra hits include slide_id:
1137
1828
1829
1877
2272
2273
2948
2949
3179
8630
11187
11188
13914
14312
14902
Still working on the problem.