Hi, Shabana:

If you are on MarkLogic 9, you might consider using TDE to project the rows you 
want from the documents.
You can then use the Optic API to retrieve rows from documents qualified by a 
cts.query().

Erik Hennum



________________________________________
From: general-boun...@developer.marklogic.com 
<general-boun...@developer.marklogic.com> on behalf of Christopher Hamlin 
<cbham...@gmail.com>
Sent: Tuesday, November 28, 2017 8:05:14 AM
To: MarkLogic Developer Discussion
Subject: Re: [MarkLogic Dev General] Regarding limiting no of co-occurrences    
returned.

You'll get tuples for the cross product over the document (that is,
the co-occurrences within the whole document).

So, is it the case that you have more than one occurrence of the two
values you are returning, in the same document?

If so, sometimes you can do some work by using the 'proximity' and
'ordered' options.

The query you pass restricts the fragments.  Unless you have
fragmentation, this equates to co-occurrences across all documents
matching the query.

/ch

On Tue, Nov 28, 2017 at 7:53 AM, shabana khan <shabana.0...@gmail.com> wrote:
> Hi All,
>
> I am using cts:value-co-occurrences() for fetching pair of values for data
> set in my project.I have a query too for restricting resultant pair only
> from specific section.
> But the problem I am facing is that duplicate results are being returned for
> each occurrence of values.
> Basically, I am looking for a way by which each pair of value should occur
> only once in result. I looked at the available options and tried using
> "limit=N" but that seems to have no effect on this.
> Filtering at later stage is not possible since it slows down the query if I
> go for selecting unique records based on some value.
>
> Is there some way to achieve it. If anyone has faced this problem please do
> share what you did exactly to get unique pair of values.
> Any heads-up will be appreciated.
>
> Thanks and Regards,
> Shabana Khan
> LinkedIn
>
>
>
>
> _______________________________________________
> General mailing list
> General@developer.marklogic.com
> Manage your subscription at:
> http://developer.marklogic.com/mailman/listinfo/general
>
_______________________________________________
General mailing list
General@developer.marklogic.com
Manage your subscription at:
http://developer.marklogic.com/mailman/listinfo/general
_______________________________________________
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to