Home | About | Sematext search-lucene.com search-hadoop.com
 Search Hadoop and all its subprojects:

Switch to Threaded View
HBase >> mail # user >> Search by name


Copy link to this message
-
Re: Search by name
You could use a prefix on the rowkey.  I imagine there are multiple
different field types, so just have an enum or something that enumerates
the different field types you have, such as name, date, email, etc.  Each
value would have a 1 char identifier, so then your search table would have
rowkeys like:

n-bryan
d-01-01-2012
etc

It's probably a good idea to choose a delimiter that is unlikely to be part
of the possible value charset though.

On Mon, Apr 2, 2012 at 4:55 PM, Dalia Sobhy <[EMAIL PROTECTED]>wrote:

> Thanks Bryan I will try it it sounds good.
>
> But another question how could I make a table with 2 row keys: name, date
> ???
>
>
> Sent from my iPad
>
> On Apr 2, 2012, at 10:47 PM, "Bryan Beaudreault" <[EMAIL PROTECTED]>
> wrote:
>
> > I imagine you don't want this search to have to scan the entire patients
> > table to find someone by their name, assuming there could be many many
> > patients.  It may be a better idea to create a search table.  The search
> > table could have search terms in the row key, and the columns could be
> > profileIds.  Then your query execution would be:
> >
> > 1) do a multiGet of the search table, for row keys 'bryan' and
> '01-01-2012'.
> > 2) intersect the returned columns
> > 2) do a multiGet using the profileIds from the intersection as the row
> keys
> > for the various gets
> >
> > If you want to partial match on names you could do a scan from 'bryan' to
> > 'bryao' (n+1) and union all of the columns in each returned row before
> > intersecting with the date search.
> >
> > This just requires you to keep the index up to date when users get added,
> > deleted, and updated.
> >
> > On Mon, Apr 2, 2012 at 4:26 PM, Dalia Sobhy <[EMAIL PROTECTED]
> >wrote:
> >
> >> Helllooo,
> >>
> >> I am using hbase thrift for my app. I have made a table for patient
> which
> >> has first a column family called info which contains his/her general
> info.
> >>
> >> I want to make a method to search for a patient by his name and date of
> >> birth. I didn't find any method for search all requires the row key and
> I
> >> instead need to method which returns the row key.
> >>
> >> So any ideasss ???
> >>
> >> Thx ;)
>