[MarkLogic Dev General] General Digest, Vol 93, Issue 6

Vedavalli Radhika radhika.kv at gmail.com
Sun Mar 4 12:33:42 PST 2012


Thanks Colleen. You have got my question right.
That was the best suggestion. I shall try out custom constraints for
my requirement.

On 3/5/12, general-request at developer.marklogic.com
<general-request at developer.marklogic.com> wrote:
> Send General mailing list submissions to
> 	general at developer.marklogic.com
>
> To subscribe or unsubscribe via the World Wide Web, visit
> 	http://developer.marklogic.com/mailman/listinfo/general
> or, via email, send a message with subject or body 'help' to
> 	general-request at developer.marklogic.com
>
> You can reach the person managing the list at
> 	general-owner at developer.marklogic.com
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of General digest..."
>
>
> Today's Topics:
>
>    1. Search API - Partial Bucketing? (Vedavalli Radhika)
>    2. Re: Search API - Partial Bucketing? (Colleen Whitney)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Sun, 4 Mar 2012 07:44:01 +0530
> From: Vedavalli Radhika <radhika.kv at gmail.com>
> Subject: [MarkLogic Dev General] Search API - Partial Bucketing?
> To: General Mark Logic Developer Discussion
> 	<general at developer.marklogic.com>
> Message-ID:
> 	<CAJ0UdA0LKFVNgmP-+U_FeY7pLncpYtPLwcya4UzdvnuQci8Kfg at mail.gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1
>
> All,
> I have a requirement to group/bucket data which has the clientid
> values lesser than and equal to count = 3 to a value called "Others"
> and show the remaining values as such.
>
> Currently for the constraint clientid with both frequency-order and
> ascending enabled in the facet-option, following is the facet
> response.
> Response 1:
> <search:facet name="clientid">
>  <search:facet-value name="Core Client" count="1">Core
> Client</search:facet-value>
>  <search:facet-value name="egfh" count="1">egfh</search:facet-value>
>  <search:facet-value name="Client 05" count="3">Client
> 05</search:facet-value>
>  <search:facet-value name="Client 03" count="5">Client
> 03</search:facet-value>
>  <search:facet-value name="Smoke Test" count="6">Smoke
> Test</search:facet-value>
>  <search:facet-value name="client39"
> count="86">client39</search:facet-value>
>  <search:facet-value name="abcd" count="101">abcd</search:facet-value>
> </search:facet>
>
> I am expecting something like below, where the values with count
> lesser than and equal to 3 should be grouped to a facet value Others.
> Response 2:
> <search:facet name="clientid">
>  <search:facet-value name="Others" count="5">Others</search:facet-value>
>  <search:facet-value name="Client 03" count="5">Client
> 03</search:facet-value>
>  <search:facet-value name="Smoke Test" count="6">Smoke
> Test</search:facet-value>
>  <search:facet-value name="client39"
> count="86">client39</search:facet-value>
>  <search:facet-value name="abcd" count="101">abcd</search:facet-value>
> </search:facet>
>
> I felt that bucketed range would not help in resolving the same. If I
> have to bucket the complete resultset, then buckets might help. But I
> just want a portion of the data to be bucketed.
>
> I can do post processing of the response and formulate what is
> requried. However, sorting would become tedious. It would be helpful, if
> it is part of the constraints/facets.
>
> Any thoughts?
>
> Radhika.
>
>
> ------------------------------
>
> Message: 2
> Date: Sun, 4 Mar 2012 09:58:37 -0800
> From: Colleen Whitney <Colleen.Whitney at marklogic.com>
> Subject: Re: [MarkLogic Dev General] Search API - Partial Bucketing?
> To: MarkLogic Developer Discussion <general at developer.marklogic.com>
> Cc: General Mark Logic Developer Discussion
> 	<general at developer.marklogic.com>
> Message-ID: <759CE5DE-E161-4BB0-9E34-C757B8176788 at marklogic.com>
> Content-Type: text/plain; charset="us-ascii"
>
> Radhika, let me see if I understand what you are trying to do.
>
> You want to group item values at one end of a range in a bucket, but use
> actual values for the rest of the range?
>
> The Search API doesn't do that out of the box. Depending on the size of your
> dataset and how much control you have over the data, you could consider
> writing a custom facet to produce the results you want, doing
> post-processing, or enriching your documents so that values can be grouped
> the way you want them.
>
> If I've misunderstood the problem, please include the options node you're
> using, because that might help make the problem clearer.
>
>
> Sent from my iPhone
>
> On Mar 3, 2012, at 6:12 PM, "Vedavalli Radhika" <radhika.kv at gmail.com>
> wrote:
>
>> All,
>> I have a requirement to group/bucket data which has the clientid
>> values lesser than and equal to count = 3 to a value called "Others"
>> and show the remaining values as such.
>>
>> Currently for the constraint clientid with both frequency-order and
>> ascending enabled in the facet-option, following is the facet
>> response.
>> Response 1:
>> <search:facet name="clientid">
>> <search:facet-value name="Core Client" count="1">Core
>> Client</search:facet-value>
>> <search:facet-value name="egfh" count="1">egfh</search:facet-value>
>> <search:facet-value name="Client 05" count="3">Client
>> 05</search:facet-value>
>> <search:facet-value name="Client 03" count="5">Client
>> 03</search:facet-value>
>> <search:facet-value name="Smoke Test" count="6">Smoke
>> Test</search:facet-value>
>> <search:facet-value name="client39"
>> count="86">client39</search:facet-value>
>> <search:facet-value name="abcd" count="101">abcd</search:facet-value>
>> </search:facet>
>>
>> I am expecting something like below, where the values with count
>> lesser than and equal to 3 should be grouped to a facet value Others.
>> Response 2:
>> <search:facet name="clientid">
>> <search:facet-value name="Others" count="5">Others</search:facet-value>
>> <search:facet-value name="Client 03" count="5">Client
>> 03</search:facet-value>
>> <search:facet-value name="Smoke Test" count="6">Smoke
>> Test</search:facet-value>
>> <search:facet-value name="client39"
>> count="86">client39</search:facet-value>
>> <search:facet-value name="abcd" count="101">abcd</search:facet-value>
>> </search:facet>
>>
>> I felt that bucketed range would not help in resolving the same. If I
>> have to bucket the complete resultset, then buckets might help. But I
>> just want a portion of the data to be bucketed.
>>
>> I can do post processing of the response and formulate what is
>> requried. However, sorting would become tedious. It would be helpful, if
>> it is part of the constraints/facets.
>>
>> Any thoughts?
>>
>> Radhika.
>> _______________________________________________
>> General mailing list
>> General at developer.marklogic.com
>> http://developer.marklogic.com/mailman/listinfo/general
>
>
> ------------------------------
>
> _______________________________________________
> General mailing list
> General at developer.marklogic.com
> http://developer.marklogic.com/mailman/listinfo/general
>
>
> End of General Digest, Vol 93, Issue 6
> **************************************
>


More information about the General mailing list