Geert, Properties are indexed, and follow the same index setting as all documents within the database. However, properties are stored in a fragment that is different from the fragment(s) of the document. Because indexes are maintained at the fragment level, querying across fragments is not as efficient as querying a single fragment. This is the root of Mike's suggestion to move the properties into the document.
I can think of a few alternatives: 1) Store the information you have in properties as collections, such as http://myproject.com/property-name/property-value. You can then use cts:collection-query() to combine multiple properties with the queries on your documents. 2) Store your properties in a node that is a sibling to the document content, then place a wrapper parent element around the two. You would have to remove the properties when returning the original document, but it is very simple as $doc/wrapper-node/document-root. Others may have other approaches. Kelly ------------------------------ Message: 9 Date: Mon, 16 Mar 2009 19:14:23 +0100 From: Geert Josten <[email protected]> Subject: RE: [MarkLogic Dev General] Searching on document properties? To: General Mark Logic Developer Discussion <[email protected]> Message-ID: <0260356c6dfe754ba6fa48e659a143382482fba...@helios.olympus.borgus.nl> Content-Type: text/plain; charset="us-ascii" 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 End of General Digest, Vol 57, Issue 20 *************************************** _______________________________________________ General mailing list [email protected] http://xqzone.com/mailman/listinfo/general
