Hyperdex and advanced queries

158 views
Skip to first unread message

Sven Hodapp

unread,
Nov 26, 2014, 8:44:05 AM11/26/14
to hyperdex...@googlegroups.com
Hi togehter,

we'd like to make complex search requests to the database. Normal use (written in Scala using the Java Bindings) is like this:

val search = new HashMap[String, AnyRef]()
search.put("attrx", "bar")
search.put("attry", "foo")

client.search("space", search)


Thats already very great. Then one can use somehting like GreaterEqual(...) or other Predicates.
With the Regex one could implement a OR-query, but I haven't found any documentation, how mighty the Regexes are in Hyperdex.
Is there any documentation? In particular about what's the hyperdex-regex-syntax.

It would be nice if it's possible to efficient do searches like this:

val search = new HashMap[String, AnyRef]()
search.put("attrx", new Regex("bar|baz"))  // using java regex syntax
search.put("attry", "foo")

client.search("space", search)


Or are there any other solutions, which use the efficiency of the database itself?
Are there other mechanisms?

Other interesting questions: What's the worst/avg/best case of hyperdex-searches? Is a search query only within a defined subspace efficient? How many dimensions are efficient achievable in a subspace and how many overhead procudes a subspace?

Thank you a lot!

Regards,
Sven

Kai Mast

unread,
Nov 26, 2014, 9:27:27 AM11/26/14
to hyperdex...@googlegroups.com
Hi Sven,

I am not sure about the Regex-Syntax myself. But OR-queries are actually on my ToDo list. I cannot give you an estimate on how long it will take until it is implemented though.

~Kai
--
You received this message because you are subscribed to the Google Groups "hyperdex-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hyperdex-discu...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Sven Hodapp

unread,
Nov 26, 2014, 2:57:42 PM11/26/14
to hyperdex...@googlegroups.com
Hi Kai,

that's great! How do you want to implement it or how should look the OR-Query-API? What should be possible or how flexible shall it be?

Something like this?:

val search = new HashMap[String, AnyRef]()
search.put("attrx", new Or("bar", "baz"))
search.put("attry", "foo")

client.search("space", search)

So one can build some kind of conjunctive normal form search-HashMaps. But I'll think this should also be possible with Regex (if they support OR-Operators)? You have any sense for the performance/complexity of your OR-Query-Implementation?

Regards,
Sven

Robert Escriva

unread,
Nov 27, 2014, 11:31:15 AM11/27/14
to hyperdex...@googlegroups.com
Hi Kai and Sven,

We'll probably have the search API look different in different
languages, but the low level C API will likely be a tree of predicates.
Then we can convert that into a disjuntive normal form to compute
multiple hyperspaces over which to search for the requisite objects.

As far as regex goes, we currently do not use them to restrict the
hyperspace, and doing so would likely be computationally difficult for
all but the simplest of regex expressions (which can almost always be
expressed as a range search over strings).

-Robert

In-Reply-To: <24636ccb-5288-4b08...@googlegroups.com>

Sven Hodapp

unread,
Nov 30, 2014, 2:26:29 PM11/30/14
to hyperdex...@googlegroups.com
Hi Robert,

you’ve got an example for a Rexgex-OR-Search-Query? Or in general any Hyperdex-Regex documentation? (Based on the actual restriction of the hypdergex regex implementaiton)

Any or-search would be very interesting for us!

Thanks a lot!

Regards,
Sven
> You received this message because you are subscribed to a topic in the Google Groups "hyperdex-discuss" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/topic/hyperdex-discuss/k8pmuJq4T0E/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to hyperdex-discu...@googlegroups.com.

Robert Escriva

unread,
Feb 2, 2015, 12:21:31 PM2/2/15
to hyperdex...@googlegroups.com
Hi Sven,

The inclusion of OR predicates is still a work in progress, but we're
working on it.

The regex implementation is the one borrowed from here:
http://www.cs.princeton.edu/courses/archive/spr09/cos333/beautiful.html

In short, it supports:

- ^ to left anchor
- $ to right anchor
- . to match any character
- * to match zero or more of the previous character

-Robert

Sven Hodapp

unread,
Mar 18, 2015, 10:11:42 AM3/18/15
to hyperdex...@googlegroups.com
Hi Robert,

thanks for your answer.

Will the OR implementation be on the roadmap for version 1.7?

Thanks for the explanation of the regex-syntax, this should be part of the official documentation. :)

And whats about NOT-expressions? I haven't found something like that in the Predicates.
Is that heavy to implement or it causes performance issues?

Regards,
Sven

Robert Escriva

unread,
Oct 1, 2015, 12:53:14 PM10/1/15
to hyperdex...@googlegroups.com
Hi Sven,

I don't think the OR implementation will be on the roadmap in the near
future, but is on our medium-long term plans.

If we implement NOT expressions in the future, it likely would not
enable queries to be more selective, but would allow server-side
filtering.

-Robert
> > > In-Reply-To: <24636ccb-5288-4b08...@googlegroups.com>
Reply all
Reply to author
Forward
0 new messages