You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hbase.apache.org by 梁景明 <fu...@gmail.com> on 2009/09/23 04:41:33 UTC
looking for better search suggestion
hi, i am looking for a better search suggestion,here is my data
id book author
1 abc me
2 def me
3 ghi you
and here is my hbase table data
1 id:1 1 book:abc abc author:me me
2 id:2 2 book:def def author:me me
3 id:3 3 book:ghi ghi author:you you
when i wanna search author ='me' and book ='def'
now,you can see i made the qualifier to be the real value ,so i can use the
scan api,
scan.addColumn("book","def");
scan.addColumn("author","me");
ResultScanner scanner = table.getScanner(scan);
and i can get the 2 row, yes it works.but i consider it not the best idea to
solve the real world searching
first sometimes it contain times ,times is a region search , like
time:2009-08-07 it can't works with time is 2009-08-07 5:00:00
second, some search should be like sql 's " like abc*" function, and here i
can't do it
so ,i want to find a better way for search ,maybe there is ,but i dont know
it ,thanks for any help.
Re: looking for better search suggestion
Posted by Angus He <an...@gmail.com>.
Hi 景明,
1. Probably relational database is more appropriate for your case.
2. A composite row key likes <author>-<book name>-<time> may also be
helpful, so you can get the item with one "Get" operation. For the
fuzzy search, try to employ the various filters provided in Hbase.
On Wed, Sep 23, 2009 at 10:41 AM, 梁景明 <fu...@gmail.com> wrote:
> hi, i am looking for a better search suggestion,here is my data
> id book author
> 1 abc me
> 2 def me
> 3 ghi you
>
> and here is my hbase table data
>
> 1 id:1 1 book:abc abc author:me me
> 2 id:2 2 book:def def author:me me
> 3 id:3 3 book:ghi ghi author:you you
>
> when i wanna search author ='me' and book ='def'
> now,you can see i made the qualifier to be the real value ,so i can use the
> scan api,
>
> scan.addColumn("book","def");
> scan.addColumn("author","me");
> ResultScanner scanner = table.getScanner(scan);
>
> and i can get the 2 row, yes it works.but i consider it not the best idea to
> solve the real world searching
>
> first sometimes it contain times ,times is a region search , like
> time:2009-08-07 it can't works with time is 2009-08-07 5:00:00
> second, some search should be like sql 's " like abc*" function, and here i
> can't do it
>
> so ,i want to find a better way for search ,maybe there is ,but i dont know
> it ,thanks for any help.
>
--
Regards
Angus