Hi..!

Try this

let $options :=

<options>
<additional-query>
 {
 cts:and-query((
for $i in fn:tokenize($query, " ")
return     cts:element-word-query(xs:QName("title"),$i)
               ))
}
</additional-query>

Thanks
Pradeep Maddireddy

On 6/1/10, Pragya Kapoor <[email protected]> wrote:
> Hi,
>
> I have a following query
>
>
> 1.       Can we use for loop, if-else statement inside the additional query?
>
> 2.       If yes then, how could we get the cts:element-word-query for all
> the tokens using for loop in below code?
>
> Also, I have to do this in additional query only.
>
>
> let $query := "RENTED HOUSE DELHI"
> let $tokens := fn:tokenize($query, " ")
> let $count := fn:count($tokens)
>
> let $options :=
> <options>
>        <additional-query>
>           { cts:and-query((
>                 cts:element-word-query(xs:QName("title"),$ tokens[1]),
>                 cts:element-word-query(xs:QName("title"),$ tokens[2]),
>                 cts:element-word-query(xs:QName("title "),$ tokens[3])))
>         ))       }
>       </additional-query>
> </options>
> let $x := search:search($query,$options)
> return
>     $x
>
>
> Thanks,
> Pragya
>
>
_______________________________________________
General mailing list
[email protected]
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to