Hi Smith

Range indexing will perform over the leaf node only. There is no provision 
to provide xpath for range indexing. In this scenario you need to remodel 
the content present in marklogic. 
        You can put the element value over which you want to create range 
indexi as its attribute value. so accordingly the new content structure 
will be as follow.Just make sure that the attribute name "facetValue" is 
unique for the content XML. add the attribute to the element on which you 
want to create range index.

<automobiles>
    <components>
        <engines> 
            <nomenclature>
                <commonName   facetValue="wankle">wankle</commonName>
            </nomenclature>
        </engines>
    </components>
.
.
.
    <components>
        <hubcaps>
            <nomenclature>
                <commonName>spinners</commonName>
            </nomenclature>
        </hubcaps>
   </components>
</automobiles>


        Alternatively you can add the element over which you want to 
create range index into separate namespace , while range indexing provide 
the namespace details with the element name. According to this point of 
view the content will be as follows.

<automobiles>
    <components>
        <engines> 
            <nomenclature>
                <commonName   xmlns="http://facet.com/commonName
">wankle</commonName>
            </nomenclature>
        </engines>
    </components>
.
.
.
    <components>
        <hubcaps>
            <nomenclature>
                <commonName>spinners</commonName>
            </nomenclature>
        </hubcaps>
   </components>
</automobiles>
Regards
Abhishek Srivastav
Systems Engineer
Tata Consultancy Services
Cell:- +91-9883389968
Mailto: [email protected]
Website: http://www.tcs.com
___________________________________________
Experience certainty. 
IT Services | Business Solutions | Outsourcing
___________________________________________



From:
Randy Smith <[email protected]>
To:
General MarkLogic Developer Discussion <[email protected]>
Date:
05/23/2011 11:48 PM
Subject:
[MarkLogic Dev General] How To Identify A Particular Repeated   Element 
And Use As A Facet
Sent by:
[email protected]



All,
I sent this earlier but didn't seem to go through.

Newbee question:

I am to the place I could use App Builder for this problem or write a 
custom Xquery app for this. However,I have a problem I don't know how to 
deal with in either case:

For a suite of .xml files that are not the simple case ( i.e. unique 
element name in each file that appear only once per file), but have 
repeated element names, for example "commonName", all through each file 
but of course are in  different context i.e. have different parents etc...

Like this :

<automobiles>
    <components>
        <engines> 
            <nomenclature>
                <commonName>wankle</commonName>
            </nomenclature>
        </engines>
    </components>
.
.
.
    <components>
        <hubcaps>
            <nomenclature>
                <commonName>spinners</commonName>
            </nomenclature>
        </hubcaps>
   </components>
</automobiles>

When setting up Element Range Indexes of course I can set up a string with 
name "commonName" but the database (using App Builder) picks up all cases 
in all contexts. How can I tell MarkLogic to pick up this one that has to 
do with "engines" to create a facet,  and leave out or ignore the 
other(s)?:

<automobiles>
    <components>
        <engines> 
            <nomenclature>
                <commonName>wankle</commonName>

Is there a way to put in the Xpath, in the Element Range window some how? 
I need a particular one for the facet and want to ignore the other(s)? I 
have tried different things but no success yet.

Any help appreciated,
Randy _______________________________________________
General mailing list
[email protected]
http://developer.marklogic.com/mailman/listinfo/general


=====-----=====-----=====
Notice: The information contained in this e-mail
message and/or attachments to it may contain 
confidential or privileged information. If you are 
not the intended recipient, any dissemination, use, 
review, distribution, printing or copying of the 
information contained in this e-mail message 
and/or attachments to it are strictly prohibited. If 
you have received this communication in error, 
please notify us by reply e-mail or telephone and 
immediately and permanently delete the message 
and any attachments. Thank you


_______________________________________________
General mailing list
[email protected]
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to