Hi Chris,
I am trying to search for xpath
"/mat:employee/mat:joining/mat:date/@mat:date-value".
I am having below xml structure:
<mat:employee>
<mat:joining>
<mat:joining-date>20120605</mat:joining-date>
<mat:date mat:date-value="2012-06-05" >20120605</mat:date>
<mat:joining>
<mat:resignation>
<mat: resignation -date>20130605</mat:resignation-date>
<mat:date mat:date-value="2013-06-05" >20130605</mat:date>
<mat:resignation>
</mat:employee>
Thanks and regards
Amit Dev
------------------------------------------------------------------------------------------------------------------------------------------
From: Christopher Hamlin <[email protected]>
Subject: Re: [MarkLogic Dev General] Element Query with Element
attribute range query is not returning proper results
To: MarkLogic Developer Discussion <[email protected]>
Message-ID:
<cadx+0qx8-x1yn_z72js5rwq+6rnkvzxkt61afdbptc4ja1w...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"
Now that I see it formatted (not on my phone), another question: do you mean
to search for either mat:joining and mat:joining-date at the same level, or
should joining-date be inside joining?
-----Original Message-----
From: Amit Kumar Dev
Sent: Monday, June 09, 2014 10:47 AM
To: [email protected]
Subject: Re: Element Query with Element attribute range query is not returning
proper results
Thanks! Chris,
I can use path range index, but I am having so many elements which are causing
the same issue.
I am not sure why my element query with attribute range index is not returning
proper result.
Query looks fine to me. I also enabled the "word position" and "element word
position" index then also getting false result in response.
Kindly suggest can we get correct results by using the below query or I have to
go for path range index.
Query:
<cts:and-query>
<cts:element-query>
<cts:element>mat:employee</cts:element>
<cts:element-query>
<cts:element>mat:joining</cts:element>
<cts:element>mat:joining-date</cts:element>
<cts:element-attribute-range-query operator="=">
<cts:element>mat:date</cts:element>
<cts:attribute>mat:date-value</cts:attribute>
<cts:value
xsi:type="xs:date">2010-11-09</cts:value>
</cts:element-attribute-range-query>
</cts:element-query>
</cts:element-query>
</cts:and-query>
Thanks and Regards
Amit Dev
Date: Sat, 7 Jun 2014 15:25:09 -0400
From: Christopher Hamlin <[email protected]>
Subject: Re: [MarkLogic Dev General] Element Query with Element
attribute range query is not returning proper results
To: MarkLogic Developer Discussion <[email protected]>
Hi Amit,
Can you use a path range index?
I think they were introduced in version 6, and
cts:valid-index-path
('/mat:employee/mat:joining/mat:joining-date/mat:date/@mat:date-value',
fn:true())
returns true for me (in version 7).
- Chris
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
http://developer.marklogic.com/pipermail/general/attachments/20140607/40849761/attachment-0001.html
Message-ID:
<CADX+0Qwtz7oQZZh_ogHyXqt_e=mz5bu0o-qo5qhmmacf1zd...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"
On Sat, Jun 7, 2014 at 3:06 AM, Amit Kumar Dev <[email protected]> wrote:
> Hi,
>
>
>
> I am trying to search for date element which come under specific
> hierarchy of elements.
>
> I constructed query to get Date element from
> /mat:employee/mat:joining/mat:joining-date/mat:date/@mat:date-value
>
>
>
> But I am getting search results for date other than ?2010-11-09?.
>
>
>
> Below is the query:
>
> <cts:and-query>
>
> <cts:element-query>
>
>
> <cts:element>mat:employee</cts:element>
>
> <cts:element-query>
>
>
> <cts:element>mat:joining</cts:element>
>
>
> <cts:element>mat:joining-date</cts:element>
>
>
> <cts:element-attribute-range-query operator="=">
>
>
> <cts:element>mat:date</cts:element>
>
>
> <cts:attribute>mat:date-value</cts:attribute>
>
>
> <cts:value xsi:type="xs:date">2010-11-09</cts:value>
>
>
> </cts:element-attribute-range-query>
>
> </cts:element-query>
>
> </cts:element-query>
>
> </cts:and-query>
>
>
>
> Whether above query is not searching for exact xpath since I have
> ?mat:date? element for other places also in xml.
>
> E.g.
> /mat:employee/mat:resignation/mat:resignation-date/mat:date/@mat:date-
> value
>
>
>
> I am using MarkLogic 6.0 and having proper element attribute range
> index for ?mat:date?.
>
>
>
**************** CAUTION - Disclaimer *****************
This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely
for the use of the addressee(s). If you are not the intended recipient, please
notify the sender by e-mail and delete the original message. Further, you are
not
to copy, disclose, or distribute this e-mail or its contents to any other
person and
any such actions are unlawful. This e-mail may contain viruses. Infosys has
taken
every reasonable precaution to minimize this risk, but is not liable for any
damage
you may sustain as a result of any virus in this e-mail. You should carry out
your
own virus checks before opening the e-mail or attachment. Infosys reserves the
right to monitor and review the content of all messages sent to or from this
e-mail
address. Messages sent to or from this e-mail address may be stored on the
Infosys e-mail system.
***INFOSYS******** End of Disclaimer ********INFOSYS***
_______________________________________________
General mailing list
[email protected]
http://developer.marklogic.com/mailman/listinfo/general