RE: [IndexedDB] Full text search?

Hi Jonas,

Thanks for your answer.

I will take into account your ideas.

Related your suggestions about building my own full search functionality on
top of IndexedDB, I'm afraid it is beyond my knowledge, but I will stay in
tune in case new libraries are released.

I hope we will see these features natively in new releases of IndexedDB.

Kind Regards,

Javier.

-----Original Message-----
From: Jonas Sicking [mailto:jonas@sicking.cc] 
Sent: lunes, 9 de abril de 2012 21:53
To: Javier Holguera Blanco
Cc: art.barstow@nokia.com; public-webapps@w3.org
Subject: Re: [IndexedDB] Full text search?

On Sun, Apr 8, 2012 at 11:23 AM, Javier Holguera Blanco
<jholguerablanco@hotmail.com> wrote:
>
>  Hi,
>
> Thanks for your answer.
>
> So, if I have understood you, in this versión we cannot expect any 
> update on this issue. The only possible search will be a "perfect 
> match" search for a concrete field. No "Start With" even, right?

You can do "start with" searches by using simple key-ranges. I.e. to iterate
all the records of an object store which have keys starting with "hello" you
simply do:

range = IDBKeyRange.bound("hello", "hello\uffff");
myObjectStore.openCursor(range);

Since we don't have a query language in IndexedDB, we also don't have things
like "search", or "sort" features. You can easily do basic searches and
sorting by traversing object stores and indexes, and if you want to do more
advanced searches and sorting you can implement that on top of the
primitives that IndexedDB provides. So you can implement your own full text
search by using object stores in clever ways. This is how all databases work
under the hood.

Building query functionality on top of IndexedDB is certainly not an easy
task though. Hopefully we will see libraries that do so very soon (I've
already seen one, though no public ones yet). Possibly we will also add some
of this functionality in future versions of IndexedDB.

/ Jonas

Received on Monday, 9 April 2012 21:42:59 UTC