Not logged in. · Lost password · Register
Forum: General Help and Support Syntax and Usage RSS
Creating pages via SFTP and updating data plugin
Avatar
ClairelyClaire #1
Member since Mar 2019 · 2 posts
Group memberships: Members
Show profile · Link to this post
Subject: Creating pages via SFTP and updating data plugin
I've created about 400 new pages using a script and SFTP. I use the data plugin to allow users to view index pages of certain properties. The trouble is, these index pages only seem to be loading pages I've visited before. Is there a way to precache all my new pages so data can find them?

I tried the searchindex plugin: https://www.dokuwiki.org/plugin:searchindex

I had to edit the plugin's files to work with my dokuwiki installation, and it runs without erroring, but it also doesn't seem to be doing anything.
This post was edited on 2019-03-06, 19:13 by ClairelyClaire.
Avatar
cziehr #2
Member since Jan 2011 · 579 posts · Location: 10119 Berlin
Group memberships: Members
Show profile · Link to this post
Using the searchindex-plugin should work.

Why have you had to edit the plugin and what did you change?
Avatar
ClairelyClaire #3
Member since Mar 2019 · 2 posts
Group memberships: Members
Show profile · Link to this post
My installation of Dokuwiki resides on Arch linux, and installing the official way ended up with different locations for plugins and inc.

inc:
/usr/share/webapps/dokuwiki/

plugins:
/lib/dokuwiki/plugins/

I haven't figured out why it doesn't work - once I pointed ajax.php to the right locations, I stopped seeing any PHP or HTTP errors in my server's logs. The plugin settings page indicates it does find at least one page, but it finishes almost instantly.

I ended up using indexer.php from my server to update the index, though.
Avatar
schplurtz (Moderator) #4
Member since Nov 2009 · 439 posts · Location: France, Finistère
Group memberships: Global Moderators, Members
Show profile · Link to this post
A third bug due to Archlinux' non standard way of installing doku.
You should consider reporting the bug to Archlinux. See
https://forum.dokuwiki.org/thread/16753 and https://forum.dokuwiki.org/thread/16658

In the mean time, You can probably run the manual indexer. See https://www.dokuwiki.org/cli#indexerphp
Be sure to run the script under the webuser account (use su  or something similar).

You may also modify your import script. Just after SFTP is done, use curl to trigger the indexer. For example, if you need to index some:page, the curl command would look like this  (assuming an sh script) :
curl "http://your.doku.server/base-doku-path/lib/exe/taskrunner.php?id=some%3Apage&$(date +%s)"

The data plugin does not use the indexer. I think the db is updated when the page is viewed for the first time.
So after calling taskrunner.php, just get the page with curl, ie something like this:
curl "http://your.doku.server/base-doku-path/doku.php?id=some%3Apage"
# or
curl "http://your.doku.server/base-doku-path/some%3Apage"

Using curl with authentification on a closed wiki will not work right away. You can use a browser to log in your wiki, and then tell curl to use your browser cookie file. curl -b /path/to/your/cookie/file http://..... See curl manpage.
Close Smaller – Larger + Reply to this post:
Verification code: VeriCode Please enter the word from the image into the text field below. (Type the letters only, lower case is okay.)
Smileys: :-) ;-) :-D :-p :blush: :cool: :rolleyes: :huh: :-/ <_< :-( :'( :#: :scared: 8-( :nuts: :-O
Special characters:
Go to forum
Imprint
This board is powered by the Unclassified NewsBoard software, 20150713-dev, © 2003-2015 by Yves Goergen
Current time: 2019-06-24, 21:45:43 (UTC +02:00)