How to search the content of h5p?
Submitted by jp_eagle on Mon, 03/16/2015 - 10:08
Forums:
there is search box at top of list of H5P Content. but looks it would only search title of each Content. are there any way to search the content of H5P Content? if there is no such function, when will it be planned to implement?
Thanks.
falcon
Mon, 03/16/2015 - 11:10
Permalink
Yes, it only searches the
jp_eagle
Mon, 03/16/2015 - 13:14
Permalink
I am quite new to php and
I am quite new to php and html5, but I may be able to do little bit of work. would you mind to tell me which php file searches the title. I would see if I can do something when I have some free time.
icc
Wed, 03/18/2015 - 13:39
Permalink
The function ajax_contents()
The function ajax_contents() in admin/class-h5p-content-admin.php search through the titles and returns the results.
You should be able to search throught the content by modifying:
$where = "WHERE hc.title LIKE '%%%s%%'";
To:
$where = "WHERE hc.title LIKE '%%%s%%' OR hc.parameters LIKE '%%%s%%' ";
But be warned, this might be slow. For good results one should index all content in a search index like Sphinx or Solr.