You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by Jean-Nicolas Boulay Desjardins <jn...@gmail.com> on 2011/10/28 03:10:29 UTC

Best way to search content in Cassandra

Normally in SQL I would use "%" operator to get what looks like what I
am searching.

Example:

[...] type = "image/%"

It would give me all the rows that have a column type with "image/" in it.

So those would show up:

image/png
image/gif
...

Is there anything similar with Cassandra?

I am also using Solandra... But I doubt that Solandra is made for that.

Are there any extensions or technics I could use?

Thank you allot in advance for any tips.

Re: Best way to search content in Cassandra

Posted by Konstantin Naryshkin <ko...@a-bb.net>.
You can do a column slice for columns between "image/" (the first
ASCII string that starts with that sub-string) and "image/~" (the last
printable ASCII string that starts with that sub-string).

On Thu, Oct 27, 2011 at 21:10, Jean-Nicolas Boulay Desjardins
<jn...@gmail.com> wrote:
> Normally in SQL I would use "%" operator to get what looks like what I
> am searching.
>
> Example:
>
> [...] type = "image/%"
>
> It would give me all the rows that have a column type with "image/" in it.
>
> So those would show up:
>
> image/png
> image/gif
> ...
>
> Is there anything similar with Cassandra?
>
> I am also using Solandra... But I doubt that Solandra is made for that.
>
> Are there any extensions or technics I could use?
>
> Thank you allot in advance for any tips.
>

Re : Best way to search content in Cassandra

Posted by Laurent Aufrechter <la...@yahoo.fr>.
Hello,

One good way to manage such things is to give your columns a name that will allow you to make some slices query...

Your column name could be something like:
image-png-other_identifier1
image-gif-other_identifier2


In your slice query, you could do a search for "image-png-A" to "image-png-Z".

Regards.

Laurent


________________________________
De : Jean-Nicolas Boulay Desjardins <jn...@gmail.com>
À : user@cassandra.apache.org
Envoyé le : Vendredi 28 Octobre 2011 3h10
Objet : Best way to search content in Cassandra

Normally in SQL I would use "%" operator to get what looks like what I
am searching.

Example:

[...] type = "image/%"

It would give me all the rows that have a column type with "image/" in it.

So those would show up:

image/png
image/gif
...

Is there anything similar with Cassandra?

I am also using Solandra... But I doubt that Solandra is made for that.

Are there any extensions or technics I could use?

Thank you allot in advance for any tips.