You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by "Pablo D. Salgado" <pd...@gmail.com> on 2010/12/01 20:03:53 UTC

Data Model Question

Hello,

I need to store "products" data (product.name, product.price, product.state
and product.owner) in Cassandra 0.7 rc1.
The problem is that I need to get "products"  where product.price > XX AND
product.price < XX AND product.name = XXX AND product.state = XXX. Also I
need return the products with pagination sorted by one of their differents
fields (product.name, product.price, product.state or product.owner). This
is a for an "advance product search" functionality.
- I know that I can do the WHERE clause with secondary index of Cassandra
0.7 but I can't make the pagination because I don't know how to implement
the "previuos" functionality for Row Pagination. (I can use OPP if needed)
- Also I know how to do pagination on columns but I can't do the WHERE
clause with more than two fields because the result may be not sorted by the
correct field.
Do you have any idea how to do the data model to reach this requirement?

Thank you in advance,

Pablo D. Salgado
psalgado@colpix.net
http://www.colpix.net

Re: Data Model Question

Posted by "Pablo D. Salgado" <pd...@gmail.com>.
Hello Aaron,

Thanks for your reply. I will try it.

Greetings,
Pablo

2010/12/2 Aaron Morton <aa...@thelastpickle.com>

> I say yes to all your questions about what you can do with Solr.
>
> Some background the on the technology...
>
> Lucene is a Java library for doing full text search
> http://lucene.apache.org/java/docs/index.html
>
> Solr turns lucene into a HTTP server and adds a bunch of other features
> such as making it easier to do faceted search (e.g. navigating a product
> list) and clustering http://lucene.apache.org/solr/
>
> Lucandra is a set of storage plugins (or a fork, not exactly sure) for
> lucene so that it uses Cassandra as the storage engine rather than it's
> custom file format. AFAIK one of the big wins is that rather than
> continually build an index in the background which is periodically switched
> to the live index, it allows lucene to build and serve from the same index.
>
>
> Solandra is to Lucandra as Solr is to Lucene AFAIK.
>
> Hope that helps.
> Aaron
>
>
> On 03 Dec, 2010,at 09:45 AM, "Pablo D. Salgado" <pd...@gmail.com>
> wrote:
>
> Hello Aaron and Jake,
>
> Thank you for your replay. I've worked with cassandra for 6 month but I
> never use Lucandra. I will try Lucandra, but I must ask (before start), Is
> possible reach my searching/pagination/sorting requeriments with Lucandra?
>
> Thank you in advance,
>
> Pablo
>
> 2010/12/2 Jake Luciani <ja...@gmail.com>
>
>> You can also run Solr with Cassandra as the backend:
>>
>> https://github.com/tjake/Lucandra/tree/solandra
>>
>> </shameless_plug>
>>
>> -Jake
>>
>>
>> On Thu, Dec 2, 2010 at 6:27 AM, aaron morton <aa...@thelastpickle.com>wrote:
>>
>>> Have you considered using Solr / lucene for the search? It has a lot more
>>> search features, and it really good at faceted navigation through a product
>>> catalogue. It sounds like it would be a better fit for this task.
>>>
>>> You can build facets for your price ranges, do the product name thing and
>>> filter by some sort product state. Sort it any way you want and paginate
>>> it.
>>>
>>> Hope that helps.
>>> Aaron
>>>
>>>
>>>
>>>
>>> On 2 Dec 2010, at 08:03, Pablo D. Salgado wrote:
>>>
>>> Hello,
>>>
>>> I need to store "products" data (product.name, product.price,
>>> product.state and product.owner) in Cassandra 0.7 rc1.
>>> The problem is that I need to get "products"  where product.price > XX
>>> AND product.price < XX AND product.name = XXX AND product.state = XXX.
>>> Also I need return the products with pagination sorted by one of their
>>> differents fields (product.name, product.price, product.state or
>>> product.owner). This is a for an "advance product search" functionality.
>>> - I know that I can do the WHERE clause with secondary index of Cassandra
>>> 0.7 but I can't make the pagination because I don't know how to implement
>>> the "previuos" functionality for Row Pagination. (I can use OPP if needed)
>>> - Also I know how to do pagination on columns but I can't do the WHERE
>>> clause with more than two fields because the result may be not sorted by the
>>> correct field.
>>> Do you have any idea how to do the data model to reach this requirement?
>>>
>>> Thank you in advance,
>>>
>>> Pablo D. Salgado
>>> psalgado@colpix.net
>>> http://www.colpix.net
>>>
>>>
>>>
>>
>

Re: Data Model Question

Posted by Aaron Morton <aa...@thelastpickle.com>.
I say yes to all your questions about what you can do with Solr. 

Some background the on the technology...

Lucene is a Java library for doing full text search http://lucene.apache.org/java/docs/index.html

Solr turns lucene into a HTTP server and adds a bunch of other features such as making it easier to do faceted search (e.g. navigating a product list) and clustering http://lucene.apache.org/solr/ 

Lucandra is a set of storage plugins (or a fork, not exactly sure) for lucene so that it uses Cassandra as the storage engine rather than it's custom file format. AFAIK one of the big wins is that rather than continually build an index in the background which is periodically switched to the live index, it allows lucene to build and serve from the same index.   

Solandra is to Lucandra as Solr is to Lucene. AFAIK.

Hope that helps. 
Aaron


On 03 Dec, 2010,at 09:45 AM, "Pablo D. Salgado" <pd...@gmail.com> wrote:

Hello Aaron and Jake,

Thank you for your replay. I've worked with cassandra for 6 month but I never use Lucandra. I will try Lucandra, but I must ask (before start), Is possible reach my searching/pagination/sorting requeriments with Lucandra?

Thank you in advance,

Pablo

2010/12/2 Jake Luciani <ja...@gmail.com>
You can also run Solr with Cassandra as the backend:

https://github.com/tjake/Lucandra/tree/solandra

</shameless_plug>

-Jake


On Thu, Dec 2, 2010 at 6:27 AM, aaron morton <aa...@thelastpickle.com> wrote:
Have you considered using Solr / lucene for the search? It has a lot more search features, and it really good at faceted navigation through a product catalogue. It sounds like it would be a better fit for this task. 

You can build facets for your price ranges, do the product name thing and filter by some sort product state. Sort it any way you want and paginate it. 

Hope that helps.
Aaron



 
On 2 Dec 2010, at 08:03, Pablo D. Salgado wrote:

Hello,

I need to store "products" data (product.name, product.price, product.state and product.owner) in Cassandra 0.7 rc1. 
The problem is that I need to get "products"  where product.price > XX AND product.price < XX AND product.name = XXX AND product.state = XXX. Also I need return the products with pagination sorted by one of their differents fields (product.name, product.price, product.state or product.owner). This is a for an "advance product search" functionality.
- I know that I can do the WHERE clause with secondary index of Cassandra 0.7 but I can't make the pagination because I don't know how to implement the "previuos" functionality for Row Pagination. (I can use OPP if needed)
- Also I know how to do pagination on columns but I can't do the WHERE clause with more than two fields because the result may be not sorted by the correct field.
Do you have any idea how to do the data model to reach this requirement?

Thank you in advance,

Pablo D. Salgado
psalgado@colpix.net
http://www.colpix.net





Re: Data Model Question

Posted by "Pablo D. Salgado" <pd...@gmail.com>.
Hello Aaron and Jake,

Thank you for your replay. I've worked with cassandra for 6 month but I
never use Lucandra. I will try Lucandra, but I must ask (before start), Is
possible reach my searching/pagination/sorting requeriments with Lucandra?

Thank you in advance,

Pablo

2010/12/2 Jake Luciani <ja...@gmail.com>

> You can also run Solr with Cassandra as the backend:
>
> https://github.com/tjake/Lucandra/tree/solandra
>
> </shameless_plug>
>
> -Jake
>
> On Thu, Dec 2, 2010 at 6:27 AM, aaron morton <aa...@thelastpickle.com>wrote:
>
>> Have you considered using Solr / lucene for the search? It has a lot more
>> search features, and it really good at faceted navigation through a product
>> catalogue. It sounds like it would be a better fit for this task.
>>
>> You can build facets for your price ranges, do the product name thing and
>> filter by some sort product state. Sort it any way you want and paginate
>> it.
>>
>> Hope that helps.
>> Aaron
>>
>>
>>
>> On 2 Dec 2010, at 08:03, Pablo D. Salgado wrote:
>>
>> Hello,
>>
>> I need to store "products" data (product.name, product.price,
>> product.state and product.owner) in Cassandra 0.7 rc1.
>> The problem is that I need to get "products"  where product.price > XX AND
>> product.price < XX AND product.name = XXX AND product.state = XXX. Also I
>> need return the products with pagination sorted by one of their differents
>> fields (product.name, product.price, product.state or product.owner).
>> This is a for an "advance product search" functionality.
>> - I know that I can do the WHERE clause with secondary index of Cassandra
>> 0.7 but I can't make the pagination because I don't know how to implement
>> the "previuos" functionality for Row Pagination. (I can use OPP if needed)
>> - Also I know how to do pagination on columns but I can't do the WHERE
>> clause with more than two fields because the result may be not sorted by the
>> correct field.
>> Do you have any idea how to do the data model to reach this requirement?
>>
>> Thank you in advance,
>>
>> Pablo D. Salgado
>> psalgado@colpix.net
>> http://www.colpix.net
>>
>>
>>
>

Re: Data Model Question

Posted by Jake Luciani <ja...@gmail.com>.
You can also run Solr with Cassandra as the backend:

https://github.com/tjake/Lucandra/tree/solandra

</shameless_plug>

-Jake

On Thu, Dec 2, 2010 at 6:27 AM, aaron morton <aa...@thelastpickle.com>wrote:

> Have you considered using Solr / lucene for the search? It has a lot more
> search features, and it really good at faceted navigation through a product
> catalogue. It sounds like it would be a better fit for this task.
>
> You can build facets for your price ranges, do the product name thing and
> filter by some sort product state. Sort it any way you want and paginate
> it.
>
> Hope that helps.
> Aaron
>
>
>
> On 2 Dec 2010, at 08:03, Pablo D. Salgado wrote:
>
> Hello,
>
> I need to store "products" data (product.name, product.price,
> product.state and product.owner) in Cassandra 0.7 rc1.
> The problem is that I need to get "products"  where product.price > XX AND
> product.price < XX AND product.name = XXX AND product.state = XXX. Also I
> need return the products with pagination sorted by one of their differents
> fields (product.name, product.price, product.state or product.owner). This
> is a for an "advance product search" functionality.
> - I know that I can do the WHERE clause with secondary index of Cassandra
> 0.7 but I can't make the pagination because I don't know how to implement
> the "previuos" functionality for Row Pagination. (I can use OPP if needed)
> - Also I know how to do pagination on columns but I can't do the WHERE
> clause with more than two fields because the result may be not sorted by the
> correct field.
> Do you have any idea how to do the data model to reach this requirement?
>
> Thank you in advance,
>
> Pablo D. Salgado
> psalgado@colpix.net
> http://www.colpix.net
>
>
>

Re: Data Model Question

Posted by aaron morton <aa...@thelastpickle.com>.
Have you considered using Solr / lucene for the search? It has a lot more search features, and it really good at faceted navigation through a product catalogue. It sounds like it would be a better fit for this task. 

You can build facets for your price ranges, do the product name thing and filter by some sort product state. Sort it any way you want and paginate it. 

Hope that helps.
Aaron


 
On 2 Dec 2010, at 08:03, Pablo D. Salgado wrote:

> Hello,
> 
> I need to store "products" data (product.name, product.price, product.state and product.owner) in Cassandra 0.7 rc1. 
> The problem is that I need to get "products"  where product.price > XX AND product.price < XX AND product.name = XXX AND product.state = XXX. Also I need return the products with pagination sorted by one of their differents fields (product.name, product.price, product.state or product.owner). This is a for an "advance product search" functionality.
> - I know that I can do the WHERE clause with secondary index of Cassandra 0.7 but I can't make the pagination because I don't know how to implement the "previuos" functionality for Row Pagination. (I can use OPP if needed)
> - Also I know how to do pagination on columns but I can't do the WHERE clause with more than two fields because the result may be not sorted by the correct field.
> Do you have any idea how to do the data model to reach this requirement?
> 
> Thank you in advance,
> 
> Pablo D. Salgado
> psalgado@colpix.net
> http://www.colpix.net
>