On Wed, May 8, 2013 at 11:32 AM, Andrew Sutherland
<
asuth...@asutherland.org> wrote:
> On 05/08/2013 11:29 AM, Anne van Kesteren wrote:
>>
>> On Wed, May 8, 2013 at 2:58 AM, Tim Chien <
timd...@mozilla.com> wrote:
>>>
>>> I wonder if there is already a discussion on Web APIs for providing
>>> such native support to the web? Would it be possible to integrate that
>>> into, say, Array.sort(), or IndexedDB range search?
>>>
>>> Please provide some pointers if there is already a discussion. Thanks :)
>>
>>
>>
http://norbertlindenberg.com/2012/12/ecmascript-internationalization-api/index.html
>> is what you want I think.
>
>
> The proposal doesn't seem to explicitly address the IndexedDB aspect of
> this. Specifically, in order to properly sort strings in IndexedDB, either
> IndexedDB needs to support specifying collation rules or the JS API needs to
> provide a way to perform case/accent/etc. folding so that a normalized
> representation can be produced that will sort closer to the collation rules.
When we developed IndexedDB initially we talked about this. But it was
punted until later versions because it's a quite complex problem space
and we wanted to get the basics right first.
This is actually the first time I've heard from developers actually
asking for it though, so this is great feedback.
What we should be able to do in a relatively short term is to add
support for using ArrayBuffers as keys. That way you can implement
sorting yourself in JS. Definitely quite painful though :(
> For full-text search purposes, it would likely be desirable to have the
> normalization/folding mechanism available for tokenization purposes.
> Although maybe at that point if things are being done in client JS space for
> experimentation, that code would just need a whole bunch of tables itself.
> And after that's working okay standards could be proposed, either including
> more JS API, IndexedDB, or other support...
Full-text search is a super complex area. We've recently talked about
adding a few low-level primitives to IndexedDB to allow you to
implement full-text search on top of it.
/ Jonas