This might help:

data(doc('sample')/Docs/Doc[MainDesc/text() contains text
'unfavorable' or FullDesc/text() contains text
'unfavorable']/DocTitle/@C)



On Thu, Sep 20, 2012 at 1:43 PM, John Best <[email protected]> wrote:
> Hi there,
>
>
>
>
>
> Below is my XML Structure –
>
>
>
> <Docs>
>
>             <Doc>
>
>                         <DocTitle C=”1”></DocTitle>
>
>                         <MainDesc></MainDesc>
>
>                         <FullDesc></FullDesc>
>
>             </Doc>
>
>             <Doc>
>
>                         <DocTitle C=”2”></DocTitle>
>
>                         <MainDesc></MainDesc>
>
>                         <FullDesc></FullDesc>
>
>             </Doc>
>
>             ………………….
>
>             ………………….
>
>             ………………….
>
> </Docs>
>
>
>
> There are at least 6000 Doc (more to be added soon). I have created a FT
> Index of the same.
>
> To search a particular word, which might be either in <MainDesc> or in
> <FullDesc>,
>
> below are my queries –
>
>
>
> Query No -1 (Time taken is 21-22 Secs)
>
>                data(doc('sample')/Docs/Doc[MainDesc[. contains text
> {'unfavorable'}] or FullDesc[. contains text {'unfavorable'}]]/DocTitle/@C)
>
>
>
> Query No -2 (Time taken is 25-26 Secs)
>
>                for $x in doc('sample')/Docs/Doc
>
>                      where $x[MainDesc[. contains text {'unfavorable'}] or
> FullDesc[. contains text {'unfavorable'}]]
>
>                      return $x/DocTitle/@C
>
>
>
>
>
> The time taken is too much. How can I lower this…?
>
> I tried ft:search(), but it doesn’t fits in here as ft:search wont return
> Nodes.
>
>
>
>
>
> Have a nice day
>
> Regards,
>
> JBest
>
>
>
>
> _______________________________________________
> BaseX-Talk mailing list
> [email protected]
> https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk
>
_______________________________________________
BaseX-Talk mailing list
[email protected]
https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk

Reply via email to