Mariano,
It looks like youre on the right track, but your mixing the two libraries in a way thats preventing you from getting your desired results. The config is good for lib-search, but lib-parser doesnt know about it. The easiest way to resolve this would be to look at the $SEARCH-FIELD-MAP variable in lib-parser.xqy and put your field definition there. Then your call should work as you expect it to. Another option would be to create a search-criteria element as described in the lib-search documentation, or by taking a look at params-to-query and its related functions (build-query-element, construct-collection-criteria, and construct-value-criteria come to mind) . Once you have a search-criteria element constructed you can pass that to the build-cts-query function within lib-search. Hope this helps some. -fs From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Mariano Grau Calín Sent: Monday, April 14, 2008 5:33 AM To: [email protected] Subject: [MarkLogic Dev General] RV: Problems with Fielded search inlib-parser Hello: I'm trying to use fielded search and write in my config file this <config xmlns="http://www.marklogic.com/ps/lib/lib-search/config" xmlns:lp="http://www.marklogic.com/ps/lib/lib-parser"> <search> <lp:search-field-map> <lp:mapping code="pub"><DIARIO/></lp:mapping> </lp:search-field-map> </search> </config> If run in cq this code import module namespace lp='http://www.marklogic.com/ps/lib/lib-parser' at 'lib-parser.xqy' let $query := lp:get-cts-query('pub:CADIZ gato') return lp:serialize-cts-query($query) I get - <cts:query xmlns:cts="http://marklogic.com/cts"> - <cts:word-query weight="1"> gato <cts:option>lang=es</cts:option> </cts:word-query> </cts:query> where field DIARIO (pub) not is found I'm not sure if use the correct functions. I'm new in lib-search and lib-parser and get to use features as date-field, sort and more, but fielded search not. Sorry by my english Mariano Grau Dpto. Informática Grupo Joly mgrau @ grupojoly.com 956 29 79 14
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________ General mailing list [email protected] http://xqzone.com/mailman/listinfo/general
