Hi Blessing,

What is the value of your $QUERY-OPTIONS variable? And what search
statement are you executing?

Kind regards,
Geert

> -----Oorspronkelijk bericht-----
> Van: [email protected] [mailto:general-
> [email protected]] Namens Blessing N
> Verzonden: maandag 9 december 2013 13:11
> Aan: MarkLogic Developer Discussion
> Onderwerp: [MarkLogic Dev General] Need help in element-constraint-query
>
> Hi,
>
> I have records of following format stored in Marklogic 6.0-2.3
>
> <Record id=1>
>    <Lab>
>       <Code>050</Code>
>       <Description>Laboratory Works</Description>
>    </Lab>
>    <Lab>
>       <Code>078</Code>
>       <Description>Laboratory Control</Description>
>    </Lab>
>    <Workshop>
>       <Code>069</Code>
>       <Description>Machine engineering<Description>
>    </Workshop>
> </Record>
>
> <Record id=2>
>    <Lab>
>       <Code>085</Code>
>       <Description>Machine engineering</Description>
>    </Lab>
>    <Lab>
>       <Code>078</Code>
>       <Description>Laboratory Control</Description>
>    </Lab>
>    <Workshop>
>       <Code>023</Code>
>       <Description>Power Consumption<Description>
>    </Workshop>
> </Record>
>
> My requirement is to provide a word query search using search:search
> to find records whose Lab/Description is "Machine engineering".
>
> If I try to execute element-word-query on <Description> it returns
> both the records. Since the requirement is to fetch only records
> having "Machine engineering" under Lab/Description I tried creating a
> element-constraint-query on <Lab> as follows
>
> <constraint name="Lab">
> <element-query ns="" name="Lab" />
> {$QUERY-OPTIONS}
> </constraint>
>
> <constraint name="LabDescription">
> <element-constraint-query>
>             <constraint-name>Lab</constraint-name>
>       <word type="xs:string" facet="false">
>            <element ns="" name="Description" />
>              {$QUERY-OPTIONS}
>        </word>
>  </element-constraint-query>
> </constraint>
>
> But it returned NIL results.
>
> Can anyone explain what is wrong in my element-constraint-query?
> Also I cannot use a path-range-query since i have to perform word
> query and not a value query.
>
> Thanks,
> Blessing.
> _______________________________________________
> General mailing list
> [email protected]
> http://developer.marklogic.com/mailman/listinfo/general
_______________________________________________
General mailing list
[email protected]
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to