Searching in indexeddb

1,988 views
Skip to first unread message

Nemo

unread,
Oct 17, 2011, 10:39:06 PM10/17/11
to Chromium HTML5
I've been through all the documentation I could find, and it seems
that I cannot make text searches in Indexeddb.
I just want the equivalent of "LIKE %s%" in indexeddb.
The range commands for string searching allow me to check start and
end of a query, but not the middle.

Context: I'm working on a Chrome extension, that has to search through
hundreds of urls. Should I move to websql? Even though Chrome supports
it now, it may drop it in future, and I'll be left with a non-working
product.

Ido

unread,
Oct 18, 2011, 2:43:03 PM10/18/11
to Chromium HTML5
Here are some good examples (and explanations) on how can you do some
searches:
https://developer.mozilla.org/en/IndexedDB/Using_IndexedDB#Using_an_index

Hope it helps,
Ido

Abhay Rana

unread,
Oct 20, 2011, 12:11:47 PM10/20/11
to Ido, Chromium HTML5
I know how to create unique and non-unique indexes, but I want to perform searches without the exact key. Something like fuzzy search.

I know I can use lower and upper range, but in this case, I'm matching URLs. Even if I create an index on the url property of the object, I cannot search for exact string matches inside the url

In essence, I want git , as well as  hub to match for github.com.

We could use a lower range cursor to search for git, but I cannot find any way that would help me match for hub using indexedb.

I just want to ask, is this a limitation of the spec itself (as I cannot find anything at www.w3.org/TR/IndexedDB/ as well), or is there some hidden way to do this.

If not, what else can I use on the client side to perform full text indexes ?

Abhay Rana
aka Capt. Nemo
http://www.captnemo.in
B.Tech (Production & Industrial Eng.)
IIT Roorkee


--
You received this message because you are subscribed to the Google Groups "Chromium HTML5" group.
To post to this group, send email to chromiu...@chromium.org.
To unsubscribe from this group, send email to chromium-html...@chromium.org.
For more options, visit this group at http://groups.google.com/a/chromium.org/group/chromium-html5/?hl=en.


Eric Bidelman

unread,
Oct 20, 2011, 12:23:06 PM10/20/11
to Abhay Rana, Ido, Chromium HTML5
Haven't tried this myself, by this library claims to impl. full-text search on top of indexedb:

Would love to hear feedback if you give it a go.
--
Eric Bidelman | Senior Developer Programs Engineer | e.bid...@google.com 

macrojd

unread,
Oct 20, 2011, 12:27:12 PM10/20/11
to Chromium HTML5

According to what I know, the feature is not included in the
specification. I was asking for that long time ago but nothing
happened
https://groups.google.com/a/chromium.org/group/chromium-html5/browse_thread/thread/faee11e7aa4dcf8a/c10a881b5da20080

It looks like we have to do it ourselves, but I didn't try yet and it
looks complicated and resource consuming.

JD

On Oct 20, 1:11 pm, Abhay Rana <capt.n...@gmail.com> wrote:
> I know how to create unique and non-unique indexes, but I want to perform
> searches without the exact key. Something like fuzzy search.
>
> I know I can use lower and upper range, but in this case, I'm matching URLs.
> Even if I create an index on the url property of the object, I cannot search
> for exact string matches *inside the url*
> *
> *
> In essence, I want *git* *, *as well as * hub *to match for *github.com*.
>
> We could use a lower range cursor to search for git, but I cannot find any
> way that would help me match for hub using indexedb.
>
> I just want to ask, is this a limitation of the spec itself (as I cannot
> find anything atwww.w3.org/TR/IndexedDB/as well), or is there some hidden
> way to do this.
>
> If not, what else can I use on the client side to perform full text indexes
> ?
>
> Abhay Rana
> aka Capt. Nemohttp://www.captnemo.in
> B.Tech (Production & Industrial Eng.)
> IIT Roorkee
>
>
>
>
>
>
>
> On Wed, Oct 19, 2011 at 12:13 AM, Ido <i...@google.com> wrote:
> > Here are some good examples (and explanations) on how can you do some
> > searches:
> >https://developer.mozilla.org/en/IndexedDB/Using_IndexedDB#Using_an_i...
>
> > Hope it helps,
> > Ido
>
> > On Oct 18, 4:39 am, Nemo <capt.n...@gmail.com> wrote:
> > > I've been through all the documentation I could find, and it seems
> > > that I cannot make text searches in Indexeddb.
> > > I just want the equivalent of "LIKE %s%" in indexeddb.
> > > The range commands for string searching allow me to check start and
> > > end of a query, but not the middle.
>
> > > Context: I'm working on a Chrome extension, that has to search through
> > > hundreds of urls. Should I move to websql? Even though Chrome supports
> > > it now, it may drop it in future, and I'll be left with a non-working
> > > product.
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Chromium HTML5" group.
> > To post to this group, send email to chromium-ht...@chromium.org.
> > To unsubscribe from this group, send email to
> > chromium-html5+unsubscr...@chromium.org.

Abhay Rana

unread,
Oct 20, 2011, 4:38:42 PM10/20/11
to macrojd, Chromium HTML5
Thanks Eric, I'll try to work with lunr, and see if it fits in.

Abhay Rana
aka Capt. Nemo
http://www.captnemo.in
B.Tech (Production & Industrial Eng.)
IIT Roorkee


To post to this group, send email to chromiu...@chromium.org.
To unsubscribe from this group, send email to chromium-html...@chromium.org.
Reply all
Reply to author
Forward
0 new messages