Hi Vivek,

Your earlier posts were sent through '[email protected]', while you 
are contacting me now through '[email protected]'. Looks 
like your company has changed the domain of your mail-address. You'd best 
contact the mailing list owner (mail address was given in the error message), 
and ask to change your subscription mail address.

About your XQuery problem: Watch carefully what you are doing. You are 
searching for elements inside documents (//para and //section), while you are 
presenting the results using base-uri. Base-uri will return the same value for 
all elements within the same document. So if your search finds 3 section 
elements matching your query, and 2 of them come from the same document, the 
base uri of those two section elements will be identical.

So, yes, it is likely that you are seeing duplicate base-uri's. It all boils 
down to the question: what are you trying to achieve in functional terms?

Kind regards,
Geert

________________________________
From: Vivek_Nagasundara [mailto:[email protected]]
Sent: donderdag 13 augustus 2009 8:46
To: Geert Josten
Subject: FW: Multiple Results Retreived

Hi Geert,

Apologies for directly mailing you on your professional account.
Since yesterday, I'm unable to send mails to the MarkLogic Developer Forum(* 
error in the attached email).
So do you by any chance know how to resolve this problem.

Mean while I tried the below query. Can you please check and confirm if it 
further needs modifications?



Regards,
Vivek N


From: Vivek_Nagasundara
Sent: Thursday, August 13, 2009 11:07 AM
To: '[email protected]'; '[email protected]'
Subject: Re: Multiple Results Retreived


Hi Geert,



I tried both the methods but using a cts: search ()  seems to be a more 
feasible approach. But the problem still persists, as we are still getting 
recurring document names in the result set.

Do you think this is the right query??



for $b in cts:search(//section, cts:and-query((cts:word-query("Mobile", 
"wildcarded"), cts:directory-query(("/Book/"), "infinity"))))



 return <a>{base-uri($b)}</a>








Regards,
Vivek N





-----Original Message-----
From: [email protected] 
[mailto:[email protected]] On Behalf Of Geert Josten
Sent: Tuesday, August 11, 2009 3:21 PM
To: General Mark Logic Developer Discussion
Subject: [MarkLogic Dev General] RE: Multiple Results Retreived



Hi Vivek,



You will search through the entire database when you replace doc("/Sample.xml") 
by doc(). The doc() function without arguments returns a node set of *all* 
database documents..



To limit your search to a specific directory you can replace doc() by 
xdmp:directory("/my/directory/", "infinity"), or use cts:and-query to combine 
your existing query with cts:directory-query("/my/directory/", "infinity").



A more elaborate description of the mentioned functions can be found here:

http://developer.marklogic.com/pubs/4.1/apidocs/SequenceBuiltins.html#fn:doc

http://developer.marklogic.com/pubs/4.1/apidocs/Ext-9.html#xdmp:directory

http://developer.marklogic.com/pubs/4.1/apidocs/cts-query.html#cts:directory-query



Kind regards,

Geert



> -----Original Message-----

> From: [email protected]

> [mailto:[email protected]] On Behalf Of

> Vivek_Nagasundara

> Sent: dinsdag 11 augustus 2009 11:35

> To: General Mark Logic Developer Discussion

> Subject: [MarkLogic Dev General] RE: Multiple Results Retreived

>

> Hi Geert,

>

>

>

> I tried using cts:search(doc()..) this is helpful when we are

> searching a particular document for content. But what I'm

> looking for is something like searching an entire database

> folder/directory.

>

>

>

> This is the query I tried using

>

>

>

> for $b in

> cts:search(doc("/Sample.xml"),cts:or-query((cts:word-query("mo

> bile","wildcarded"),cts:word-query("mobile","case-insensitive"))))

>

> return base-uri($b)

>

>

>

> Can you help me out in this

>

>

>

>

>

> Regards,

>

> Vivek N

>

>

>

>

>

> From: [email protected]

> [mailto:[email protected]] On Behalf Of

> Geert Josten

> Sent: Monday, August 10, 2009 6:00 PM

> To: General Mark Logic Developer Discussion

> Subject: [MarkLogic Dev General] RE: Multiple Results Retreived

>

>

>

> Hi Vivek,

>

>

>

> The cts:search searches in fragments, and selects subelements

> as expressed in the searchable XPath only afterwards. I

> recommend using the following expression instead, just for

> clarity. It is equivalent:

>

>

>

> cts:search(doc(), ...)//para

>

>

>

> If you intend to limit the searching to within the para

> element, you should use element-query constructors instead.

>

>

>

> HTH..

>

>

>

> Kind regards,

>

> Geert

>

>

>

>

>

>

>

> Drs. G.P.H. Josten

>

> Consultant

>

>

>

>

>

> Daidalos BV

>

> Source of Innovation

>

> Hoekeindsehof 1-4

>

> 2665  JZ  Bleiswijk

>

> Tel.: +31 (0) 10 850 1200

>

> Fax: +31 (0) 10 850 1199

>

> www.daidalos.nl <http://www.daidalos.nl/>

>

> KvK 27164984

>

>

> De informatie - verzonden in of met dit emailbericht - is

> afkomstig van Daidalos BV en is uitsluitend bestemd voor de

> geadresseerde. Indien u dit bericht onbedoeld hebt ontvangen,

> verzoeken wij u het te verwijderen. Aan dit bericht kunnen

> geen rechten worden ontleend.

>

>

>

>     From: [email protected]

> [mailto:[email protected]] On Behalf Of

> Vivek_Nagasundara

>     Sent: maandag 10 augustus 2009 14:20

>     To: [email protected]

>     Subject: [MarkLogic Dev General] Multiple Results Retreived

>

>     Hi,

>

>

>

>     I am actually running a search query to retrieve a set

> of documents from a directory based on a keyword. The query

> is executed successfully but the result sets are repeating.

>

>

>

>     Here is the query and the results are pasted below.

>

>     Can you suggest me a method to obtain unique values by

> avoiding redundancy in the results, I even tried using

> distinct-nodes() still the same problem persists.

>

>

>

>

>

>     for $x in cts:search(//para, cts:or-query(("from",

> cts:directory-query(("/book/sports/", "/book/business/"), "1"))))

>

>     return <a>{base-uri(distinct-nodes($x))}</a>

>

>

>

>

>

>

>

>     Search Result:

>

>

>

>      <a>/Book/business/Media story/Rational Software_doc.xml</a>

>

>       <a>/Book/business/Media story/Rational Software_doc.xml</a>

>

>       <a>/Book/business/Media story/Rational Software_doc.xml</a>

>

>       <a>/Book/business/Media story/Rational Software_doc.xml</a>

>

>       <a>/Book/business/Media story/Rational Software_doc.xml</a>

>

>       <a>/Book/business/Media story/Rational Software_doc.xml</a>

>

>       <a>/Book/business/XBox time/Rational Software_doc.xml</a>

>

>       <a>/Book/business/XBox time/Rational Software_doc.xml</a>

>

>       <a>/Book/business/XBox time/Rational Software_doc.xml</a>

>

>       <a>/Book/business/XBox time/Rational Software_doc.xml</a>

>

>       <a>/Book/business/XBox time/Rational Software_doc.xml</a>

>

>       <a>/Book/business/XBox time/Rational Software_doc.xml</a>

>

>       <a>/Book/business/Fall of Delhi Metro/MainStory_doc.xml</a>

>

>       <a>/Book/business/Fall of Delhi Metro/MainStory_doc.xml</a>

>

>       <a>/Book/business/Current Scenario/Rational

> Software_doc.xml</a>

>

>       <a>/Book/business/Current Scenario/Rational

> Software_doc.xml</a>

>

>       <a>/Book/business/Current Scenario/Rational

> Software_doc.xml</a>

>

>       <a>/Book/business/Current Scenario/Rational

> Software_doc.xml</a>

>

>       <a>/Book/business/Current Scenario/Rational

> Software_doc.xml</a>

>

>       <a>/Book/business/Current Scenario/Rational

> Software_doc.xml</a>

>

>       <a>/Archives/Rational Software_doc_xhtml.xml</a>

>

>       <a>/Archives/Rational Software_doc_xhtml.xml</a>

>

>       <a>/Archives/Rational Software_doc_xhtml.xml</a>

>

>       <a>/Archives/Rational Software_doc_xhtml.xml</a>

>

>       <a>/Archives/Rational Software_doc_xhtml.xml</a>

>

>       <a>/Archives/Rational Software_doc_xhtml.xml</a>

>

>

>

>

>

>

>

>     Regards,

>

>     Vivek N

>

>

>

>

>

>

>

>

> ________________________________

>

>

>     DISCLAIMER:

>     This email (including any attachments) is intended for

> the sole use of the intended recipient/s and may contain

> material that is CONFIDENTIAL AND PRIVATE COMPANY

> INFORMATION. Any review or reliance by others or copying or

> distribution or forwarding of any or all of the contents in

> this message is STRICTLY PROHIBITED. If you are not the

> intended recipient, please contact the sender by email and

> delete all copies; your cooperation in this regard is appreciated.

>

>

>

>

> ________________________________

>

> DISCLAIMER:

> This email (including any attachments) is intended for the

> sole use of the intended recipient/s and may contain material

> that is CONFIDENTIAL AND PRIVATE COMPANY INFORMATION. Any

> review or reliance by others or copying or distribution or

> forwarding of any or all of the contents in this message is

> STRICTLY PROHIBITED. If you are not the intended recipient,

> please contact the sender by email and delete all copies;

> your cooperation in this regard is appreciated.

>

> _______________________________________________

General mailing list

[email protected]

http://xqzone.com/mailman/listinfo/general



________________________________
DISCLAIMER:
This email (including any attachments) is intended for the sole use of the 
intended recipient/s and may contain material that is CONFIDENTIAL AND PRIVATE 
COMPANY INFORMATION. Any review or reliance by others or copying or 
distribution or forwarding of any or all of the contents in this message is 
STRICTLY PROHIBITED. If you are not the intended recipient, please contact the 
sender by email and delete all copies; your cooperation in this regard is 
appreciated.
_______________________________________________
General mailing list
[email protected]
http://xqzone.com/mailman/listinfo/general

Reply via email to