Hi Christian,
Am 18.03.2013 um 15:54 schrieb Christian Grün christian.gruen@gmail.com :
So I have the DB 'collect' open and then do: db:create('annotate-abcdef')
as you guessed, you’ll have to specify a document path, in which you can then add new nodes. Every XML document has a root node, and vice versa, so it’s conceptually not possible to only create a root node without a document. Please note, however, that your second argument is simply the name and path of your document, and does not read any input.
Ah, so I would better use
db:create('annotate-$name', <root/>, 'annotate-$name.xml')
Somehow it is not clear from the Wiki, I thought I had to use an existing document with some data in it. So this document does not have to exist before?
How do I set UPDINDEX ON for the new DB?
The following lines should do what you need:
declare option db:ftindex "on"; declare option db:updindex "on"; db:create('annotate', <root/>, 'root.xml')
If you activate the FTINDEX option before creating a database, the OPTIMIZE call will always create/update your full-text index.
Ah, I will try this.
To be able to use ft:mark, I would have to optimize the DB with db:optimize() after having added nodes, is this correct?
ft:mark() also works without full-text index, but the index solution is usually faster.
OK, since some of the DBs will have more than 400 entries, it is save to always optimize the index after updating.
Thanks and best regards
Cerstin