Hi Geert,

Properties are indexed, and you can search on properties by putting the
document properties in the first argument of cts:search.  For example,
the following:

cts:search(xdmp:document-properties(), "hello")

will return all of the properties that have "hello" in them.

You can also use the properties:: axis in XPath to switch to the
document properties (in a predicate, for example).

Joins between the document and its corresponding properties document are
fast for simple types in the properties.  Both fragments still need to
be fetched, which is what Mike was getting at I think, but for many
applications properties work extremely well.  CPF, for example, stores
its metadata in properties.

See chapter 14 in the Developer's Guide (p112) for more information on
properties.

-Danny

-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Geert
Josten
Sent: Monday, March 16, 2009 11:18 AM
To: General Mark Logic Developer Discussion
Subject: RE: [MarkLogic Dev General] Searching on document properties?

And..

How bad is doing things like:

cts:search(collection(...),
...)[xdmp:document-get-properties(base-uri(.), 'mystatus') = 'true']

Kind regards,
Geert

> -----Original Message-----
> From: [email protected] 
> [mailto:[email protected]] On Behalf Of 
> Geert Josten
> Sent: maandag 16 maart 2009 19:14
> To: General Mark Logic Developer Discussion
> Subject: RE: [MarkLogic Dev General] Searching on document properties?
> 
> Hi Mike,
> 
> It is fixed filter on the search result, excluding document 
> that have a certain status marked with a document-property. 
> Due to certain design restrictions (the content is digitally 
> signed from outside MarkLogic Server), we are not allowed to 
> add additional information to the content. At least not 
> noticeably. If we would add it as part of content, we would 
> have to strip it out, before delivering it again. Doesn't 
> sound really nice either.
> 
> I noticed that other cts functions do include properties, 
> like the cts:element-words function. Is there a particular 
> reason why property documents are not indexed?
> 
> Kind regards,
> Geert
> 
> > -----Original Message-----
> > From: [email protected]
> > [mailto:[email protected]] On Behalf 
> Of Michael 
> > Blakeley
> > Sent: maandag 16 maart 2009 18:05
> > To: General Mark Logic Developer Discussion
> > Subject: Re: [MarkLogic Dev General] Searching on document 
> properties?
> > 
> > Geert,
> > 
> > If you want to combine restrictions in the sense of 
> AND('dog', 'cat'), 
> > then properties are not the right tool for the job. Instead, the 
> > properties should be brought into the main document 
> content, so that 
> > all the query terms are indexed together.
> > 
> > See also http://markmail.org/thread/op3dsj2seetrodvk
> > 
> > -- Mike
> > 
> > On 2009-03-16 10:00, Geert Josten wrote:
> > > Hi,
> > >
> > > Is there a way to search on document properties using
> > cts:search? I would like to combine restrictions on document 
> > properties with other criteria. I have now added a 
> predicate filter on 
> > the search result, but that doesn't look right nor efficient.
> > >
> > > Kind regards,
> > > Geert
> > >
> > >
> > > Drs. G.P.H. Josten
> > > Consultant
> > >
> > >
> > > http://www.daidalos.nl/
> > > Daidalos BV
> > > Source of Innovation
> > > Hoekeindsehof 1-4
> > > 2665 JZ Bleiswijk
> > > Tel.: +31 (0) 10 850 1200
> > > Fax: +31 (0) 10 850 1199
> > > 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.
> > >
> > >
> > >
> > > _______________________________________________
> > > 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

Reply via email to