[MarkLogic Dev General] Search API - Partial Bucketing?

Colleen Whitney Colleen.Whitney at marklogic.com
Sun Mar 4 09:58:37 PST 2012


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


More information about the General mailing list