Hi, Gurbeer:

On the specific question, the Search API can facet on the values in an element 
attribute, element content, JSON key, field, or path.

As a general practice, where possible, it's a good idea to move types out of 
the values of attributes and into element and attribute names so you can index 
the content of each name separately, as in:

                                <entitlements>
                                                <domainId>684</domainId>
                                                <kbId>688</kbId>
                                                <wfId>65</wfId>
                                                <accesstype>0</accesstype>
                                </entitlements>
                                <contentexpiration>
                                                
<effectivedate>2013-08-05</effectivedate>
                                                <updatecycle>3</updatecycle>
                                                
<expirydate>2014-08-05</updatecycle>
                                </contentexpiration>
                                <content>
                                                <CRTForms>
                                                                     
<SOWCRT>26515</SOWCRT>
                                                </CRTForms>
                                </content>

Applications can always get the local-name() of elements or attributes to 
operate on such names as values.

Hoping that's useful,


Erik Hennum

________________________________
From: [email protected] 
[[email protected]] on behalf of Singh, Gurbeer 
[[email protected]]
Sent: Tuesday, August 06, 2013 12:33 PM
To: [email protected]
Subject: [MarkLogic Dev General] Query on creating facet element

Hi ,

We are in the process of restructure our XML, I was wondering how to use facet 
in new structure, earlier we have configure facet on element and attribute , 
but how we can do in this structure
I need to create a facet on domainId, contentTypelevel_0, contentTypelevel_1



                                <updatedby multivalue="N" name="gurbeers" 
id=""><![CDATA[Gurbeer Singh]]></updatedby>
                                <updatedon multivalue="N" name="2013-08-05" 
id="8/5/2013 8:53:14.953 AM"></updatedon>
                                <comments multivalue="N" name="" 
id=""><![CDATA[Test Structure]]></comments>
                                <entitlements multivalue="Y" name="" id="" 
childelement="type">
                                                <type multivalue="N" 
name="domainId" id="684">684</type>
                                                <type multivalue="N" 
name="kbId" id="688">688</type>
                                                <type multivalue="N" 
name="wfId" id="65">65</type>
                                                <type multivalue="N" 
name="accesstype" id="0">0</type>
                                </entitlements>
                                <contentexpiration multivalue="Y" name="" id="" 
childelement="type">
                                                <type multivalue="N" 
name="effectivedate" id="2013-08-05">Aug 05, 2013</type>
                                                <type multivalue="N" 
name="updatecycle" id="12">3</type>
                                                <type multivalue="N" 
name="expirydate" id="2014-08-05">Aug 05, 2014</type>
                                </contentexpiration>
                                <contentType multivalue="Y" name="" id="" 
childelement="type">
                                                <type multivalue="Y" name="" 
id="" childelement="contentTypelevel_0">
                                                                
<contentTypelevel_0 multivalue="Y" name="CRT Forms" id="26525" 
childelement="contentTypelevel_1">
                                                                                
<contentTypelevel_1  multivalue="N" name="SOW CRT" id="26515">
                                                                                
</contentTypelevel_1>
                                                                
</contentTypelevel_0>
                                                </type>
                                </contentType>


Or I should change this structure like this
< domainId >684</ domainId > ??


~Gurbeer


________________________________

NOTICE: Morgan Stanley is not acting as a municipal advisor and the opinions or 
views contained herein are not intended to be, and do not constitute, advice 
within the meaning of Section 975 of the Dodd-Frank Wall Street Reform and 
Consumer Protection Act. If you have received this communication in error, 
please destroy all electronic and paper copies and notify the sender 
immediately. Mistransmission is not intended to waive confidentiality or 
privilege. Morgan Stanley reserves the right, to the extent permitted under 
applicable law, to monitor electronic communications. This message is subject 
to terms available at the following link: 
http://www.morganstanley.com/disclaimers If you cannot access these links, 
please notify us by reply message and we will send the contents to you. By 
messaging with Morgan Stanley you consent to the foregoing.
_______________________________________________
General mailing list
[email protected]
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to