[MarkLogic Dev General] Excluding elements from search

Danny Sokolsky dsokolsky at marklogic.com
Tue Jun 19 10:52:54 PDT 2007


Yes, the field configuration is additive to the regular configuration.
So if you set up the field to include document and exclude authors, you
can get that behavior by using cts:field-word-query (or the other field
APIs) and you can still get the old behavior using cts:element-query
and/or cts:word-query.

-Danny 

-----Original Message-----
From: general-bounces at developer.marklogic.com
[mailto:general-bounces at developer.marklogic.com] On Behalf Of Peter
Hickman
Sent: Tuesday, June 19, 2007 1:14 AM
To: General Mark Logic Developer Discussion
Subject: Re: [MarkLogic Dev General] Excluding elements from search


Danny Sokolsky wrote:
> Hi Peter,
>
> Yes, Fields (new in 3.2) are a good way to get the behavior you 
> describe. You can create a field and include the element "document" 
> and exclude the element "authors".  This will include everything under

> documents until it gets to a descendant that is in the excluded list 
> ("authors" in your case).  If it then encounters another included 
> descendant, it will include that until it finds an excluded one.
>
> Then you can query the field with cts:field-word-query.
>
> The Administrator's Guide has a chapter (Chapter 10, Fields Database
> Settings) describing how to create a field and how the include/exclude

> logic works.
>
> Hope that helps,
> -Danny
>
>   

Thanks for the response, I'll start to read the Administrator's guide as

soon as I have upgraded our installation. However can I just confirm 
that having set this up I will still be able to search <document> and 
<authors> when I need to or will the settings permanently exclude 
<authors> from all searches? It's this last bit that concerns me, I only

need to exclude <authors> sometimes.

I'll get on to reading the guide soon.

Thanks

-- 
Peter Hickman.

Semantico, Lees House, 21-23 Dyke Road, Brighton BN1 3FE
t: 01273 358223
f: 01273 723232
e: peter.hickman at semantico.com
w: www.semantico.com

_______________________________________________
General mailing list
General at developer.marklogic.com
http://xqzone.com/mailman/listinfo/general


More information about the General mailing list