[MarkLogic Dev General] A to Z buckets with search:search?

Jakob Fix jakob.fix at gmail.com
Wed Mar 7 14:31:59 PST 2012


Thanks Geert, for your reply.

Your code example seems to imply that the title element would have to
contain exactly one letter which would be used to fill the different
buckets. This and more in-depth reading of the documentation for the
search:range element suggests that the most efficient way would be to
add a "start-letter" attribute (or element) for each document that
could be used.

Another idea could possibly be the search:custom element but
documentation is a bit sparse.

cheers,
Jakob.



On Wed, Mar 7, 2012 at 21:22, Geert Josten <geert.josten at dayon.nl> wrote:
> Hi Jakob,
>
> Not entirely sure, but I'd expect it to be quite similar to date buckets:
>
>        <constraint name="title">
>                <range type="xs:string">
>                        <element ns="" name="title"/>
>                                <bucket name="A" ge="A" lt="B">A</bucket>
>
> (untested)
>
> Kind regards,
> Geert
>
>> -----Oorspronkelijk bericht-----
>> Van: general-bounces at developer.marklogic.com [mailto:general-
>> bounces at developer.marklogic.com] Namens Jakob Fix
>> Verzonden: woensdag 7 maart 2012 17:21
>> Aan: General Mark Logic Developer Discussion
>> Onderwerp: [MarkLogic Dev General] A to Z buckets with search:search?
>>
>> Hi,
>>
>> I'd like to (ab)use the search API to provide buckets for each letter
>> in the alphabet and in each bucket I'd like to have all those
>> documents whose titles start with that letter (let's assume
>> non-significant words such as "the" and "a" at the title's start have
>> been removed).  What options would I have to use to achieve that using
>> search:search?
>>
>> thanks in advance,
>> Jakob.
>> _______________________________________________
>> 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


More information about the General mailing list