You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by André Maldonado <an...@gmail.com> on 2012/03/12 18:50:02 UTC

Relational data

Hi.

I need to setup an index that have relational data. This index will be for
houses to rent, where the user will search for date, price, holydays (by
name), etc.

The problem is that the same house can have different prices for different
dates.

If I denormalyze this data, I will show the same house multiple times in
the resultset, and I don't want this.

So, for example:

House  Holyday       Price per day
1          Xmas          $ 75.00
1          July 4          $ 50.00
1          Valentine's   $ 15.00
2          Xmas           $ 50.00
2          July 4          $ 10.00

If I query for all data, I'll get 3 documents for the same house (house 1),
but I just want to show it one time to the end-user.

There is some way to do this in Solr (Without processing it in my app)?

Thank's

*
----------------------------------------------------------------------------------------------
*
*"E conhecereis a verdade, e a verdade vos libertará." (João 8:32)*

 *andre.maldonado*@gmail.com <an...@gmail.com>
 (11) 9112-4227

<http://www.orkut.com.br/Main#Profile?uid=2397703412199036664>
<http://www.orkut.com.br/Main#Profile?uid=2397703412199036664>
<http://www.facebook.com/profile.php?id=100000659376883>
  <http://twitter.com/andremaldonado> <http://www.delicious.com/andre.maldonado>
  <https://profiles.google.com/105605760943701739931>
<http://www.linkedin.com/pub/andr%C3%A9-maldonado/23/234/4b3>
  <http://www.youtube.com/andremaldonado>

Re: Relational data

Posted by Tomás Fernández Löbbe <to...@gmail.com>.
You could use the grouping feature, depending on your needs:
http://wiki.apache.org/solr/FieldCollapsing

2012/3/12 André Maldonado <an...@gmail.com>

> Hi.
>
> I need to setup an index that have relational data. This index will be for
> houses to rent, where the user will search for date, price, holydays (by
> name), etc.
>
> The problem is that the same house can have different prices for different
> dates.
>
> If I denormalyze this data, I will show the same house multiple times in
> the resultset, and I don't want this.
>
> So, for example:
>
> House  Holyday       Price per day
> 1          Xmas          $ 75.00
> 1          July 4          $ 50.00
> 1          Valentine's   $ 15.00
> 2          Xmas           $ 50.00
> 2          July 4          $ 10.00
>
> If I query for all data, I'll get 3 documents for the same house (house 1),
> but I just want to show it one time to the end-user.
>
> There is some way to do this in Solr (Without processing it in my app)?
>
> Thank's
>
> *
>
> ----------------------------------------------------------------------------------------------
> *
> *"E conhecereis a verdade, e a verdade vos libertará." (João 8:32)*
>
>  *andre.maldonado*@gmail.com <an...@gmail.com>
>  (11) 9112-4227
>
> <http://www.orkut.com.br/Main#Profile?uid=2397703412199036664>
> <http://www.orkut.com.br/Main#Profile?uid=2397703412199036664>
> <http://www.facebook.com/profile.php?id=100000659376883>
>  <http://twitter.com/andremaldonado> <
> http://www.delicious.com/andre.maldonado>
>  <https://profiles.google.com/105605760943701739931>
> <http://www.linkedin.com/pub/andr%C3%A9-maldonado/23/234/4b3>
>  <http://www.youtube.com/andremaldonado>
>

Re: Relational data

Posted by André Maldonado <an...@gmail.com>.
Thank's Ahmet and Tomás. It worked like a charm.

*
----------------------------------------------------------------------------------------------
*
*"E conhecereis a verdade, e a verdade vos libertará." (João 8:32)*

 *andre.maldonado*@gmail.com <an...@gmail.com>
 (11) 9112-4227

<http://www.orkut.com.br/Main#Profile?uid=2397703412199036664>
<http://www.orkut.com.br/Main#Profile?uid=2397703412199036664>
<http://www.facebook.com/profile.php?id=100000659376883>
  <http://twitter.com/andremaldonado> <http://www.delicious.com/andre.maldonado>
  <https://profiles.google.com/105605760943701739931>
<http://www.linkedin.com/pub/andr%C3%A9-maldonado/23/234/4b3>
  <http://www.youtube.com/andremaldonado>




On Mon, Mar 12, 2012 at 2:54 PM, Ahmet Arslan <io...@yahoo.com> wrote:

> > The problem is that the same house can have different prices
> > for different
> > dates.
> >
> > If I denormalyze this data, I will show the same house
> > multiple times in
> > the resultset, and I don't want this.
> >
> > So, for example:
> >
> > House  Holyday       Price per
> > day
> > 1          Xmas
> >     $ 75.00
> > 1          July 4
> >       $ 50.00
> > 1
> > Valentine's   $ 15.00
> > 2          Xmas
> >      $ 50.00
> > 2          July 4
> >       $ 10.00
> >
> > If I query for all data, I'll get 3 documents for the same
> > house (house 1),
> > but I just want to show it one time to the end-user.
> >
> > There is some way to do this in Solr (Without processing it
> > in my app)?
>
>
> http://wiki.apache.org/solr/FieldCollapsing could work.
>

Re: Relational data

Posted by Ahmet Arslan <io...@yahoo.com>.
> The problem is that the same house can have different prices
> for different
> dates.
> 
> If I denormalyze this data, I will show the same house
> multiple times in
> the resultset, and I don't want this.
> 
> So, for example:
> 
> House  Holyday       Price per
> day
> 1          Xmas     
>     $ 75.00
> 1          July 4   
>       $ 50.00
> 1         
> Valentine's   $ 15.00
> 2          Xmas     
>      $ 50.00
> 2          July 4   
>       $ 10.00
> 
> If I query for all data, I'll get 3 documents for the same
> house (house 1),
> but I just want to show it one time to the end-user.
> 
> There is some way to do this in Solr (Without processing it
> in my app)?


http://wiki.apache.org/solr/FieldCollapsing could work.