Hi Oscar,
You will have to maintain a separate collection in order to do that.
That separate collection will contain the node-pre or node-id of each value to be indexed.
Storing the node-pre is the faster way but require a append-only main collection if you do not want to have to recreate the entire separate collection
after each main collection update.
1.
Add the new map entries (value-to-be-indexed,node-pre or node-id) in the separate collection
2.
Reindex the separate collection
An even faster solution is to store the values in text nodes and node-pre or node-id in attributes in order to create only a text index (or vice/versa).
That will speed up the reindexation.
To use this custom index :
1.
Use the db:attribute or db:text function on the separate collection to obtain the list of node-id or node-pre associated with a given
value,
2.
For each node-xx, use the db:open-xx function on the main collection to obtain the real node.
If you are familiar with CouchBase/CouchDB, it’s a little like creating a view ;-)
But such a built-in feature would be great !
Best regards,
Fabrice Etanchaud
Questel/Orbit
De : basex-talk-bounces@mailman.uni-konstanz.de [mailto:basex-talk-bounces@mailman.uni-konstanz.de]
De la part de Oscar Herrera
Envoyé : mercredi 24 septembre 2014 03:30
À : basex-talk@mailman.uni-konstanz.de
Objet : [basex-talk] Text Index just over some elements
Hi,
I'm trying to tune my BaseX with a text index only over certain elements, is that possible?, what I have found so far is to create a text index, but I have plenty of nodes on my documents that don't need to
be indexed since is very unlikely that a search over that value will occur.
So, is there any way in which I can create a text index only over certain elements and not all of them?, if not, is this planned on a near future?
Thank you,
Oscar H