Usually it's best to materialize nulls. That way they can be indexed. -- Mike
On 22 Sep 2013, at 21:43 , Gontla Praveen <[email protected]> wrote: > Hi All, > > Can someone suggest me why cts:element-values will count null values also. > > Below is the same scenario which i came across of. > declare namespace pr="http://www.w3schools.com"; > let $query := cts:directory-query("/onlinedocs/") > let $vals := > cts:element-values(xs:QName("pr:filtervalue"),(),("collation=http://sample.com")$query) > > return for $i in $vals > return <filter value="{$i}">{cts:frequency($i)}</filter> > > The above value returns me all distinct values that are available in my DB > under the element pr:filtervalue including null value. > > Below is the sample $vals response: > > <filter value="online">40</filter> > <filter value="online_new">90</filter> > <filter value="offline">50</filter> > <filter value="offline_new">20</filter> > <filter value="">40</filter> > > Thanks in Advance > > Thanks, > Praveen > _______________________________________________ > General mailing list > [email protected] > http://developer.marklogic.com/mailman/listinfo/general _______________________________________________ General mailing list [email protected] http://developer.marklogic.com/mailman/listinfo/general
