[MarkLogic Dev General] Excluding elements from search

Peter Hickman peter.hickman at semantico.com
Tue Jun 19 01:13:46 PDT 2007


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



More information about the General mailing list