You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by J T <jt...@googlemail.com> on 2010/11/11 00:55:04 UTC

Non-Unique Indexes, How ?

Hi,

I'm trying to work out a way to support a non-unique index.

For example, lets say I have a contact list, where its possible to have
Names that are the same but are for different people and so should have
different contact entries but I'd want to be able to search on their full
name and get a list of potential matches.

In cassandra, as far as i know, column names and row keys need to be unique
- so unless I some how construct a unique form of the full name to use as a
column name or key value I'm left with using the column value (as opposed to
the name) and the indexing facility in 0.7 - but its not clear to me whether
the 0.7 index facility would support non-unique column values this way.

e.g.

CF: Contacts (with an index on 'fullname')

key : id1 { fullname : "John Brown", address : "London" }
key : id2 { fullname : "John Brown", address : "Paris"    }

Would the 0.7 index on fullname allow me to lookup the 2 entries if I
searched on "John" or "John Brown" ?

Regards

Jason

Unsubscribe

Posted by Vibhaw P Rajan <vi...@in.ibm.com>.
Warm regards,
Vibhaw Rajan
Application Developer-Mainframes
IBM India Pvt. Ltd.  DLF IT Park, Chennai, India
Office +91 44 22723552  Mobile +91 996 253 3029
Email   vibrajan@in.ibm.com
"Success is not final, failure is not fatal: it is the courage to continue
that counts"


Re: Non-Unique Indexes, How ?

Posted by Jonathan Ellis <jb...@gmail.com>.
Yes.

On Wed, Nov 10, 2010 at 6:39 PM, J T <jt...@googlemail.com> wrote:
> Ok, so non-unique indexes are supported, but only full equality matches on
> the values are supported right now.
> Will it in the future allow for partial/range matches ?
>
> e.g. Find all contacts with a J as the first letter ?
> Jason
> On Thu, Nov 11, 2010 at 12:13 AM, Jonathan Ellis <jb...@gmail.com> wrote:
>>
>> On Wed, Nov 10, 2010 at 5:55 PM, J T <jt...@googlemail.com> wrote:
>> > CF: Contacts (with an index on 'fullname')
>> > key : id1 { fullname : "John Brown", address : "London" }
>> > key : id2 { fullname : "John Brown", address : "Paris"    }
>> > Would the 0.7 index on fullname allow me to lookup the 2 entries if I
>> > searched on "John" or "John Brown" ?
>>
>> Yes, the latter.
>>
>> --
>> Jonathan Ellis
>> Project Chair, Apache Cassandra
>> co-founder of Riptano, the source for professional Cassandra support
>> http://riptano.com
>
>



-- 
Jonathan Ellis
Project Chair, Apache Cassandra
co-founder of Riptano, the source for professional Cassandra support
http://riptano.com

Re: Non-Unique Indexes, How ?

Posted by J T <jt...@googlemail.com>.
Ok, so non-unique indexes are supported, but only full equality matches on
the values are supported right now.

Will it in the future allow for partial/range matches ?

e.g. Find all contacts with a J as the first letter ?

Jason

On Thu, Nov 11, 2010 at 12:13 AM, Jonathan Ellis <jb...@gmail.com> wrote:

> On Wed, Nov 10, 2010 at 5:55 PM, J T <jt...@googlemail.com> wrote:
> > CF: Contacts (with an index on 'fullname')
> > key : id1 { fullname : "John Brown", address : "London" }
> > key : id2 { fullname : "John Brown", address : "Paris"    }
> > Would the 0.7 index on fullname allow me to lookup the 2 entries if I
> > searched on "John" or "John Brown" ?
>
> Yes, the latter.
>
> --
> Jonathan Ellis
> Project Chair, Apache Cassandra
> co-founder of Riptano, the source for professional Cassandra support
> http://riptano.com
>

Re: Non-Unique Indexes, How ?

Posted by Jonathan Ellis <jb...@gmail.com>.
On Wed, Nov 10, 2010 at 5:55 PM, J T <jt...@googlemail.com> wrote:
> CF: Contacts (with an index on 'fullname')
> key : id1 { fullname : "John Brown", address : "London" }
> key : id2 { fullname : "John Brown", address : "Paris"    }
> Would the 0.7 index on fullname allow me to lookup the 2 entries if I
> searched on "John" or "John Brown" ?

Yes, the latter.

-- 
Jonathan Ellis
Project Chair, Apache Cassandra
co-founder of Riptano, the source for professional Cassandra support
http://riptano.com