It's possible. I would grab a fresh copy off of XQuery Commons and do a diff to see what changes you might have in your file.
Cheers! Chris -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Alan Darnell Sent: Friday, November 21, 2008 1:31 PM To: General Mark Logic Developer Discussion Subject: Re: [MarkLogic Dev General] lib-search and collections Chris, We think we figured this out : In the function construct-collection-criteria in the modules search- ui.xqy there is this bit of code: let $criteria := for $set-id in $set-ids let $names := for $coll in $collections let $tokens := split-search-item($coll) where fn:count($tokens) = 2 and $tokens[1] = $set-id return <search:value>{$tokens[2]}</search:value> where fn:not($names = "all") return <collections xmlns="http://www.marklogic.com/ps/lib/lib-search "> {$names} </collections> Which outputs the values but not the set-id name. So we edited as follows:to pull in the set-ids and that now gets us the results we were looking for. I'm wondering if we might be working on an out of date copy of search-ui.xqy. let $criteria := for $set-id in $set-ids let $names := for $coll in $collections let $tokens := split-search-item($coll) where fn:count($tokens) = 2 and $tokens[1] = $set-id return <search:value>{$tokens[2]}</search:value> where fn:not($names = "all") return <collections xmlns="http://www.marklogic.com/ps/lib/lib-search "> <search:set-id>{$set-ids}</search:set-id> <<< added this line {$names} </collections> Alan On Nov 20, 2008, at 8:47 PM, Christopher Welch wrote: > That is odd. Try running this in CQ: > > (: import the search-ui module :) > > sdis:params-to-query(<params><q>water</q><coll>rep:orca</coll></ > params>) > > This should return the appropriate search:search-criteria with set-id. > Here's what it returns when I run it (the version from > developer.marklogic.com.) > > <search-criteria fast-pagination="true"> > <term> > <text>water</text> > </term> > <collections> > <set-id>rep</set-id> > <value>orca</value> > </collections> > </search-criteria> > > And you're very welcome. > > Cheers! > Chris > > -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Alan > Darnell > Sent: Thursday, November 20, 2008 8:32 PM > To: General Mark Logic Developer Discussion > Subject: Re: [MarkLogic Dev General] lib-search and collections > > Christopher, > > This is the XML search object that is being generated after processing > the URL: > > http://marklogic.scholarsportal.info:8016/odesi/search.xqy?q=water&field > =&coll=rep%3Acora > > <search-criteria fast-pagination="true" allow-empty-terms="false" > xmlns="http://www.marklogic.com/ps/lib/lib-search"> > <term> > <text>water</text> > </term> > <collections> > <search:value xmlns:search="http://www.marklogic.com/ps/lib/lib- > search">cora</search:value> > </collections> > </search-criteria> > > But it isn't picking up the set-id value and so the results are coming > back as zero hits. > > I wonder if I should be unquoting the value of the coll parameter > before passing it into build-query-element. > > Despite this problem, thanks for all this lib-search and versi code -- > we couldn't build the XQuery apps we have without it. > > Alan > > > On Nov 20, 2008, at 7:15 PM, Christopher Welch wrote: > >> Hi Alan, >> >> It looks like you are trying to use lib-search with the rapid >> application demo? Is that true? >> >> Are you also trying to generate facets on the two collections? >> >> I would say you have right idea, in either case. I would configure >> lib-search just as you said. >> >> With that configuration, when the querystring has >> "coll=repository:odesi" in it, the function build-query-element in >> search-ui.xqy will generate the following collection criteria to >> resolve >> your query appropriately: >> >> <search:collections> >> <search:set-id>repository</search:set-id> >> <search:value>odesi</search:value> >> </search:collections> >> >> Cheers! >> Chris >> >> -----Original Message----- >> From: [EMAIL PROTECTED] >> [mailto:[EMAIL PROTECTED] On Behalf Of Alan >> Darnell >> Sent: Thursday, November 20, 2008 5:58 PM >> To: General Mark Logic Developer Discussion >> Subject: [MarkLogic Dev General] lib-search and collections >> >> I'm having difficulty understanding the lib-search documentation on >> how to incorporate collection limits into searches. >> >> It looks like lib-search is looking for the parameter "coll" for >> collection limits, but I can't figure out what the value should to >> pair with coll. >> >> For instance, say I have two collections defined as >> >> http://scholarsportal.info/cora >> http://scholarsportal.info/odesi >> >> and I want to offer users the opportunity to limit a search to the >> content of one or both of these collections. I've set up a radio >> button control group with the name "coll" but I can't figure out what >> the values should be associated with the radio buttons. >> >> The example config file has a collections section like this: >> >> <collection-sets> >> <collection-set id="publication"> >> >> <base-uri>http://www.foo.com/collections/pubs/</base-uri> >> </collection-set> >> </collection-sets> >> >> >> So do I need something like this: >> >> <collection-sets> >> <collection-set id="repository"> >> <base-uri>http://scholarsportal.info/</base-uri> >> </collection> >> </collection-sets> >> >> >> And then should the coll parameter take a value something like >> >> coll=repository:odesi >> >> Or am I completely lost? >> >> Thanks in advance. >> >> Alan >> _______________________________________________ >> General mailing list >> [email protected] >> http://xqzone.com/mailman/listinfo/general >> _______________________________________________ >> General mailing list >> [email protected] >> http://xqzone.com/mailman/listinfo/general > > _______________________________________________ > General mailing list > [email protected] > http://xqzone.com/mailman/listinfo/general > _______________________________________________ > General mailing list > [email protected] > http://xqzone.com/mailman/listinfo/general _______________________________________________ General mailing list [email protected] http://xqzone.com/mailman/listinfo/general _______________________________________________ General mailing list [email protected] http://xqzone.com/mailman/listinfo/general
