Reindex All Content!

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
kierweb
Forum Members
Forum Members
Posts: 41
Joined: Tue May 15, 2007 8:45 pm

Reindex All Content!

Post by kierweb »

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
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm
Location: Fernie British Columbia, Canada

Re: Reindex All Content!

Post by calguy1000 »

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.
kierweb
Forum Members
Forum Members
Posts: 41
Joined: Tue May 15, 2007 8:45 pm

Re: Reindex All Content!

Post by kierweb »

How do I access these functions?

Currently the PHP script is seperate from the CMS functions and accesses the database direct.

Darren
Jos
Support Guru
Support Guru
Posts: 4017
Joined: Wed Sep 05, 2007 8:03 pm
Location: The Netherlands

Re: Reindex All Content!

Post by Jos »

kierweb wrote:How do I access these functions?
You can take the addarticle.php from the news module as an example: http://viewsvn.cmsmadesimple.org/filede ... rticle.php

kierweb wrote:Currently the PHP script is seperate from the CMS functions and accesses the database direct.
Then I guess it won't be possible to use the cmsms functions
replytomk3

Re: Reindex All Content!

Post by replytomk3 »

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.
Will this most interesting module be released to the public?
kierweb
Forum Members
Forum Members
Posts: 41
Joined: Tue May 15, 2007 8:45 pm

Re: Reindex All Content!

Post by kierweb »

I've got the command i needed to automate the reindex which was ...

Code: Select all

  $gCms->modules['Search']['object']->Reindex();
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.
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12709
Joined: Thu Mar 09, 2006 5:32 am
Location: Arizona

Re: Reindex All Content!

Post by Dr.CSS »

That would be considered a plugin/tag and CMSMS has cron in the admin, site admin section...
kierweb
Forum Members
Forum Members
Posts: 41
Joined: Tue May 15, 2007 8:45 pm

Re: Reindex All Content!

Post by kierweb »

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.
Post Reply

Return to “Modules/Add-Ons”