You can also use cts:search to find the document.  As long as it is included in 
the first argument and it matches the query, it does not matter if it is text 
or XML. For example, the following returns the text document:

xdmp:document-insert("hello.txt", text{"this is a text document"}) ;

cts:search(doc(), "this is a text")

-Danny

-----Original Message-----
From: [email protected] 
[mailto:[email protected]] On Behalf Of Geert Josten
Sent: Wednesday, July 21, 2010 8:10 AM
To: General Mark Logic Developer Discussion
Subject: Re: [MarkLogic Dev General] Data Insert - XML/Text/Binary Files

Hi Tony,

You mean, add some id to the xml wrapper of the text data to be able to tie it 
to the related xml? Yes, you could.

Kind regards,
Geert 

> -----Original Message-----
> From: [email protected] 
> [mailto:[email protected]] On Behalf Of 
> Tony Mariella
> Sent: woensdag 21 juli 2010 16:41
> To: General Mark Logic Developer Discussion
> Subject: Re: [MarkLogic Dev General] Data Insert - 
> XML/Text/Binary Files
> 
> Should I just add another tag to the XML like setId and use 
> the same setId in the xml as well as the text data ?
>  
> -Tony
> 
>  
> 
> > From: [email protected]
> > To: [email protected]
> > Date: Wed, 21 Jul 2010 16:26:36 +0200
> > Subject: Re: [MarkLogic Dev General] Data Insert - XML/Text/Binary 
> > Files
> > 
> > Hi Tony,
> > 
> > I guess easiest is to use adhoc query. I recall an old 
> thread that mentions that you can't use insertContent to do 
> it together with uploading the XML itself, but you can use 
> adhoc query and some external vars to do both in an adhoc query..
> > 
> > Kind regards,
> > Geert
> > 
> > > -----Original Message-----
> > > From: [email protected]
> > > [mailto:[email protected]] On 
> Behalf Of Tony 
> > > Mariella
> > > Sent: woensdag 21 juli 2010 16:09
> > > To: [email protected]
> > > Subject: Re: [MarkLogic Dev General] Data Insert - 
> XML/Text/Binary 
> > > Files
> > > 
> > > Thanks Geert,
> > > 
> > > How do I setup document-properties using XCC ?
> > > 
> > > -Tony
> > > 
> > > 
> > > 
> > > > From: [email protected]
> > > > To: [email protected]
> > > > Date: Wed, 21 Jul 2010 16:00:51 +0200
> > > > Subject: Re: [MarkLogic Dev General] Data Insert - 
> XML/Text/Binary 
> > > > Files
> > > > 
> > > > Hi Tony,
> > > > 
> > > > You could try to store the text and binary as
> > > document-properties, but that might be a bit bloated. 
> Though, if you 
> > > really want to be able to do word-queries on the text, 
> you will need 
> > > to wrap it in XML anyhow; non-xml is ignored by the indexer. A 
> > > relatively elegant way to store relations between object, 
> is to put 
> > > xlink-style values in document-properties, but you could derive 
> > > relations from directory location or filename or something alike 
> > > just as well. You will have to do some manual work though, the 
> > > database can't recognize the relation itself..
> > > > 
> > > > Kind regards,
> > > > Geert
> > > > 
> > > > >
> > > > 
> > > > 
> > > > drs. G.P.H. (Geert) Josten
> > > > Consultant
> > > > 
> > > > Daidalos BV
> > > > Hoekeindsehof 1-4
> > > > 2665 JZ Bleiswijk
> > > > 
> > > > T +31 (0)10 850 1200
> > > > F +31 (0)10 850 1199
> > > > 
> > > > mailto:[email protected]
> > > > http://www.daidalos.nl/
> > > > 
> > > > KvK 27164984
> > > > 
> > > > 
> > > > De informatie - verzonden in of met dit e-mailbericht - 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 Tony
> > > > > Mariella
> > > > > Sent: woensdag 21 juli 2010 15:53
> > > > > To: [email protected]
> > > > > Subject: [MarkLogic Dev General] Data Insert -
> > > XML/Text/Binary Files
> > > > >
> > > > > I have a dataset that consists of an XML file and related
> > > text and
> > > > > binary files.
> > > > > At some point I would like to be able to do text queries
> > > on the text
> > > > > files (like OracleText).
> > > > > I'm not quite sure how to insert the data in such a 
> way that the 
> > > > > text or binary files are related to the xml data.
> > > > >
> > > > > Using the XCC library I currently use
> > > session.insertContent() on the
> > > > > xml data to insert the xml into Marklogic.
> > > > > How can I add the text files into the database so 
> that they are 
> > > > > related to the xml data ?
> > > > >
> > > > > Tony Mariella
> > > > > Raytheon COmpany
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > _______________________________________________
> > > > General mailing list
> > > > [email protected]
> > > > http://developer.marklogic.com/mailman/listinfo/general
> > > 
> > > 
> > _______________________________________________
> > General mailing list
> > [email protected]
> > http://developer.marklogic.com/mailman/listinfo/general
> 
> 
_______________________________________________
General mailing list
[email protected]
http://developer.marklogic.com/mailman/listinfo/general
_______________________________________________
General mailing list
[email protected]
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to