I am writing a php script which will be run by cron to parse the text from pdf and doc files within the uploads module and place that information into the description therefore allowing users to search the contents of the files.
The php script is working correctly, but I am having to manually reindex the search keywords by going into the admin pages / search.
Does anyone know how I access the reindex function (which i notice is in modules/search/search.tools.php) from within my php script, therefore making it fully automated.
Thanks
Darren
Reindex All Content!
-
- Support Guru
- Posts: 8169
- Joined: Tue Oct 19, 2004 6:44 pm
- Location: Fernie British Columbia, Canada
Re: Reindex All Content!
The Search module has an AddWords method.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
Re: Reindex All Content!
How do I access these functions?
Currently the PHP script is seperate from the CMS functions and accesses the database direct.
Darren
Currently the PHP script is seperate from the CMS functions and accesses the database direct.
Darren
Re: Reindex All Content!
You can take the addarticle.php from the news module as an example: http://viewsvn.cmsmadesimple.org/filede ... rticle.phpkierweb wrote:How do I access these functions?
Then I guess it won't be possible to use the cmsms functionskierweb wrote:Currently the PHP script is seperate from the CMS functions and accesses the database direct.
Re: Reindex All Content!
Will this most interesting module be released to the public?kierweb wrote:I am writing a php script which will be run by cron to parse the text from pdf and doc files within the uploads module and place that information into the description therefore allowing users to search the contents of the files.
Re: Reindex All Content!
I've got the command i needed to automate the reindex which was ...
One more little problem to iron out - which is some pdf files are not parsing the text correctly - but once thats fixed, I will probrably package it up and release it.
I will point out its not actually a module - its one php file which you would need to set up a cron job to run at regular intervals.
Code: Select all
$gCms->modules['Search']['object']->Reindex();
I will point out its not actually a module - its one php file which you would need to set up a cron job to run at regular intervals.
Re: Reindex All Content!
That would be considered a plugin/tag and CMSMS has cron in the admin, site admin section...
Re: Reindex All Content!
On the site I have coded this on, the reindex routine seems to down the site while its doing it ... and the reindex can take about 10 minutes. So I have set the cron job to run it at 2am in the morning, when no one will be viewing it.