struggling a bit with querying a catalog
This snippet works: zcat=context.litcatalog results=zcat({'query' : '/habraken/documenten/dftest','level' : 0}) return results Can I combine this (path index query) query with a ZCTextIndex with searches for a certain phrasein a certain field? If so, can any point to the right syntax? Henny
----- Original Message ----- From: "Henny van der Linde" <linde@inline-info.nl>
This snippet works:
zcat=context.litcatalog results=zcat({'query' : '/habraken/documenten/dftest','level' : 0}) return results
Can I combine this (path index query) query with a ZCTextIndex with searches for a certain phrasein a certain field?
If so, can any point to the right syntax?
If you have created an index for your 'certain field' as a ZCTextIndex (don't forget to set up the lexicon) then you should just be able to add the search in the same query: results=zcat({'query' : '/habraken/documenten/dftest','level' : 0, 'textindexfield' : 'searchphrase'}) To make the search more useful you can substitute a variable for the hardcoded search phrase in the above example. searchvar = 'searchphrase' results=zcat({'query' : '/habraken/documenten/dftest','level' : 0, 'textindexfield' : searchvar}) Jonathan
participants (2)
-
Henny van der Linde -
Jonathan Hobbs