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

Reply via email to