Loading...
 
Skip to main content

Development


Search indexing

Is there a way to force tikiwiki to reindex all its pages (ie by calling a php script)? The only way I've been able to get it to update the indexing is to refresh a page a bunch of times, and that only worked once. I need to find a way to make sure the search is up to date, as I will be updating pages frequently.
Thanks!

For the old search and for the fulltext search, it is done automically by mysql. (module search)
For the new search (module new search) (the one handles by tikiwiki)
you need to do a new script (to be able to run it in a cron not to have timeout) that will call the routine refresh_index_wiki_all from the library lib/search/refresh-functions.php

sylvie


thanks, this should help alot. I'm a little new to the whole php/tiki thing, and I'm not sure how to call the function correctly. so far, I've tried just calling it directly, and it says "Call to a member function on a non-object" so it looks like I need to call this function off of an instantiation of some object...is there a tiki object I need to call this off of? How do I get ahold of the right object in my new script?
Thanks

-Edit:
I found the place in the admin pages where this function gets called, and I've tried to adapt the code so that I could automate it, but the best I could do is get the same error as above. Mostly, though, when I'd try to go to my new page, it would just show the wiki's homepage. I need to be able to activate a refresh from some VB.NET code (if I have to do this by executing a script in another language from VB, then I can do that) with no user involvement.
Please help!
Thanks

You will have notice messages, you can ignore

Image
Copy to clipboard
require_once('tiki-setup.php'); require_once('lib/search/refresh-functions.php'); set_time_limit(30000);//will not work if php is in safe mode- take away if php has no time limit refresh_index_wiki_all();


sylvie

> You will have notice messages, you can ignore

> Image
Copy to clipboard
> require_once('tiki-setup.php'); > require_once('lib/search/refresh-functions.php'); > set_time_limit(30000);//will not work if php is in safe mode- take away if php has no time limit > refresh_index_wiki_all(); >

>
> sylvie

Is there something special I will need to do to run this? I tried putting it in a file in the tiki directory, and pointing my browser to that file, but it would just redirect me to my tiki homepage.
Thanks for the help

What I did say. It must be a php file with extension .php and with
superior?php and ?> inclusing the php code (replace superior with <
Dammned ... difficult to enter some pgp code with the tikwiki filter

sylvie

> What I did say. It must be a php file with extension .php and with
> superior?php and ?> inclusing the php code (replace superior with <
> Dammned ... difficult to enter some pgp code with the tikwiki filter
>
> sylvie

yeah, i put it in php code, but it wouldnt seem to work no matter what i did. i ended up just putting a flag in the database, and adding a check for the flag in the tiki-index.php page, so that if the flag is set it will update the search indexing with the code you gave. works good enough for me. Thanks for your help.