Re: Item Facet

2009-08-09 Thread Avlesh Singh
This is how it goes:

   1. You create a dynamic field in the schema called "product_*". This
   means that while indexing, you can create fields starting with "product_"
   dynamically for a document.
   2. If a document, doc1, is dealing with prod1 and prod2, you create
   fields called product_prod1 and product_prod2 and populate them with the
   corresponding "values".
   3. If a patch for
SOLR-247<https://issues.apache.org/jira/browse/SOLR-247>is committed,
you can perform a facet query, as simple as:
   facet.field=product_*. This should give you results in the manner you
   expect. product_prod1:all values, product_prod2:all_values and so on ...

Hope this helps.

Cheers
Avlesh

On Fri, Aug 7, 2009 at 7:27 PM, David Lojudice Sobrinho
wrote:

> Thanks Avlesh.
>
> But I didn't get it. How a dynamic field would aggregate values in query
> time?
>
> On Thu, Aug 6, 2009 at 11:14 PM, Avlesh Singh wrote:
> > Dynamic fields might be an answer. If you had a field called "product_*"
> and
> > these were populated with the corresponding values during indexing then
> > faceting on these fields will give you the desired behavior.
> >
> > The only catch here is that the product names have to be known upfront. A
> > wildcard support for field names in facet.fl is still to come in Solr.
> > Here's the issue - https://issues.apache.org/jira/browse/SOLR-247
> >
> > Cheers
> > Avlesh
> >
> > On Fri, Aug 7, 2009 at 3:33 AM, David Lojudice Sobrinho
> > wrote:
> >
> >> I can't reindex because the aggregated/grouped result should change as
> >> the query changes... in other words, the result must by dynamic
> >>
> >> We've been thinking about a new handler for it something like:
> >>
> >>
> >>
> /select?q=laptop&rows=0&itemfacet=on&itemfacet.field=product_name,min(price),max(price)
> >>
> >> Does it make sense? Something easier ready to use?
> >>
> >>
> >> On Thu, Aug 6, 2009 at 6:05 PM, Ge, Yao (Y.) wrote:
> >> > If you can reindex, simply rebuild the index with fields replaced by
> >> > combining existing fields.
> >> > -Yao
> >> >
> >> > -Original Message-
> >> > From: David Lojudice Sobrinho [mailto:dalss...@gmail.com]
> >> > Sent: Thursday, August 06, 2009 4:17 PM
> >> > To: solr-user@lucene.apache.org
> >> > Subject: Item Facet
> >> >
> >> > Hi...
> >> >
> >> > Is there any way to group values like shopping.yahoo.com or
> >> > shopper.cnet.com do?
> >> >
> >> > For instance, I have documents like:
> >> >
> >> > doc1 - product_name1 - value1
> >> > doc2 - product_name1 - value2
> >> > doc3 - product_name1 - value3
> >> > doc4 - product_name2 - value4
> >> > doc5 - product_name2 - value5
> >> > doc6 - product_name2 - value6
> >> >
> >> > I'd like to have a result grouping by product name with the value
> >> > range per product. Something like:
> >> >
> >> > product_name1 - (value1 to value3)
> >> > product_name2 - (value4 to value6)
> >> >
> >> > It is not like the current facet because the information is grouped by
> >> > item, not the entire result.
> >> >
> >> > Any idea?
> >> >
> >> > Thanks!
> >> >
> >> > David Lojudice Sobrinho
> >> >
> >>
> >>
> >>
> >> --
> >> __
> >>
> >>   David L. S.
> >> dalss...@gmail.com
> >> __
> >>
> >
>
>
>
> --
> __
>
>   David L. S.
> dalss...@gmail.com
> __
>


Re: Item Facet

2009-08-07 Thread David Lojudice Sobrinho
The behavior i'm expecting is something similar to a GROUP BY in a
relational database.

SELECT product_name, model, min(price), max(price), count(*) FROM t
GROUP BY product_name, model

The current schema:

product_name (type: text)
model (type: text)
price (type: sfloat)


On Fri, Aug 7, 2009 at 11:07 AM, Yao Ge wrote:
>
> Are your product_name* fields numeric fields (integer or float)?
>
>
> Dals wrote:
>>
>> Hi...
>>
>> Is there any way to group values like shopping.yahoo.com or
>> shopper.cnet.com do?
>>
>> For instance, I have documents like:
>>
>> doc1 - product_name1 - value1
>> doc2 - product_name1 - value2
>> doc3 - product_name1 - value3
>> doc4 - product_name2 - value4
>> doc5 - product_name2 - value5
>> doc6 - product_name2 - value6
>>
>> I'd like to have a result grouping by product name with the value
>> range per product. Something like:
>>
>> product_name1 - (value1 to value3)
>> product_name2 - (value4 to value6)
>>
>> It is not like the current facet because the information is grouped by
>> item, not the entire result.
>>
>> Any idea?
>>
>> Thanks!
>>
>> David Lojudice Sobrinho
>>
>>
>
> --
> View this message in context: 
> http://www.nabble.com/Item-Facet-tp24853669p24865535.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>
>



-- 
__

   David L. S.
dalss...@gmail.com
__


Re: Item Facet

2009-08-07 Thread Yao Ge

Are your product_name* fields numeric fields (integer or float)? 


Dals wrote:
> 
> Hi...
> 
> Is there any way to group values like shopping.yahoo.com or
> shopper.cnet.com do?
> 
> For instance, I have documents like:
> 
> doc1 - product_name1 - value1
> doc2 - product_name1 - value2
> doc3 - product_name1 - value3
> doc4 - product_name2 - value4
> doc5 - product_name2 - value5
> doc6 - product_name2 - value6
> 
> I'd like to have a result grouping by product name with the value
> range per product. Something like:
> 
> product_name1 - (value1 to value3)
> product_name2 - (value4 to value6)
> 
> It is not like the current facet because the information is grouped by
> item, not the entire result.
> 
> Any idea?
> 
> Thanks!
> 
> David Lojudice Sobrinho
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Item-Facet-tp24853669p24865535.html
Sent from the Solr - User mailing list archive at Nabble.com.



Re: Item Facet

2009-08-07 Thread David Lojudice Sobrinho
Thanks Avlesh.

But I didn't get it. How a dynamic field would aggregate values in query time?

On Thu, Aug 6, 2009 at 11:14 PM, Avlesh Singh wrote:
> Dynamic fields might be an answer. If you had a field called "product_*" and
> these were populated with the corresponding values during indexing then
> faceting on these fields will give you the desired behavior.
>
> The only catch here is that the product names have to be known upfront. A
> wildcard support for field names in facet.fl is still to come in Solr.
> Here's the issue - https://issues.apache.org/jira/browse/SOLR-247
>
> Cheers
> Avlesh
>
> On Fri, Aug 7, 2009 at 3:33 AM, David Lojudice Sobrinho
> wrote:
>
>> I can't reindex because the aggregated/grouped result should change as
>> the query changes... in other words, the result must by dynamic
>>
>> We've been thinking about a new handler for it something like:
>>
>>
>> /select?q=laptop&rows=0&itemfacet=on&itemfacet.field=product_name,min(price),max(price)
>>
>> Does it make sense? Something easier ready to use?
>>
>>
>> On Thu, Aug 6, 2009 at 6:05 PM, Ge, Yao (Y.) wrote:
>> > If you can reindex, simply rebuild the index with fields replaced by
>> > combining existing fields.
>> > -Yao
>> >
>> > -Original Message-
>> > From: David Lojudice Sobrinho [mailto:dalss...@gmail.com]
>> > Sent: Thursday, August 06, 2009 4:17 PM
>> > To: solr-user@lucene.apache.org
>> > Subject: Item Facet
>> >
>> > Hi...
>> >
>> > Is there any way to group values like shopping.yahoo.com or
>> > shopper.cnet.com do?
>> >
>> > For instance, I have documents like:
>> >
>> > doc1 - product_name1 - value1
>> > doc2 - product_name1 - value2
>> > doc3 - product_name1 - value3
>> > doc4 - product_name2 - value4
>> > doc5 - product_name2 - value5
>> > doc6 - product_name2 - value6
>> >
>> > I'd like to have a result grouping by product name with the value
>> > range per product. Something like:
>> >
>> > product_name1 - (value1 to value3)
>> > product_name2 - (value4 to value6)
>> >
>> > It is not like the current facet because the information is grouped by
>> > item, not the entire result.
>> >
>> > Any idea?
>> >
>> > Thanks!
>> >
>> > David Lojudice Sobrinho
>> >
>>
>>
>>
>> --
>> __
>>
>>   David L. S.
>> dalss...@gmail.com
>> __
>>
>



-- 
__

   David L. S.
dalss...@gmail.com
__


Re: Item Facet

2009-08-06 Thread Avlesh Singh
Dynamic fields might be an answer. If you had a field called "product_*" and
these were populated with the corresponding values during indexing then
faceting on these fields will give you the desired behavior.

The only catch here is that the product names have to be known upfront. A
wildcard support for field names in facet.fl is still to come in Solr.
Here's the issue - https://issues.apache.org/jira/browse/SOLR-247

Cheers
Avlesh

On Fri, Aug 7, 2009 at 3:33 AM, David Lojudice Sobrinho
wrote:

> I can't reindex because the aggregated/grouped result should change as
> the query changes... in other words, the result must by dynamic
>
> We've been thinking about a new handler for it something like:
>
>
> /select?q=laptop&rows=0&itemfacet=on&itemfacet.field=product_name,min(price),max(price)
>
> Does it make sense? Something easier ready to use?
>
>
> On Thu, Aug 6, 2009 at 6:05 PM, Ge, Yao (Y.) wrote:
> > If you can reindex, simply rebuild the index with fields replaced by
> > combining existing fields.
> > -Yao
> >
> > -Original Message-
> > From: David Lojudice Sobrinho [mailto:dalss...@gmail.com]
> > Sent: Thursday, August 06, 2009 4:17 PM
> > To: solr-user@lucene.apache.org
> > Subject: Item Facet
> >
> > Hi...
> >
> > Is there any way to group values like shopping.yahoo.com or
> > shopper.cnet.com do?
> >
> > For instance, I have documents like:
> >
> > doc1 - product_name1 - value1
> > doc2 - product_name1 - value2
> > doc3 - product_name1 - value3
> > doc4 - product_name2 - value4
> > doc5 - product_name2 - value5
> > doc6 - product_name2 - value6
> >
> > I'd like to have a result grouping by product name with the value
> > range per product. Something like:
> >
> > product_name1 - (value1 to value3)
> > product_name2 - (value4 to value6)
> >
> > It is not like the current facet because the information is grouped by
> > item, not the entire result.
> >
> > Any idea?
> >
> > Thanks!
> >
> > David Lojudice Sobrinho
> >
>
>
>
> --
> __
>
>   David L. S.
> dalss...@gmail.com
> __
>


Re: Item Facet

2009-08-06 Thread David Lojudice Sobrinho
I can't reindex because the aggregated/grouped result should change as
the query changes... in other words, the result must by dynamic

We've been thinking about a new handler for it something like:

/select?q=laptop&rows=0&itemfacet=on&itemfacet.field=product_name,min(price),max(price)

Does it make sense? Something easier ready to use?


On Thu, Aug 6, 2009 at 6:05 PM, Ge, Yao (Y.) wrote:
> If you can reindex, simply rebuild the index with fields replaced by
> combining existing fields.
> -Yao
>
> -Original Message-
> From: David Lojudice Sobrinho [mailto:dalss...@gmail.com]
> Sent: Thursday, August 06, 2009 4:17 PM
> To: solr-user@lucene.apache.org
> Subject: Item Facet
>
> Hi...
>
> Is there any way to group values like shopping.yahoo.com or
> shopper.cnet.com do?
>
> For instance, I have documents like:
>
> doc1 - product_name1 - value1
> doc2 - product_name1 - value2
> doc3 - product_name1 - value3
> doc4 - product_name2 - value4
> doc5 - product_name2 - value5
> doc6 - product_name2 - value6
>
> I'd like to have a result grouping by product name with the value
> range per product. Something like:
>
> product_name1 - (value1 to value3)
> product_name2 - (value4 to value6)
>
> It is not like the current facet because the information is grouped by
> item, not the entire result.
>
> Any idea?
>
> Thanks!
>
> David Lojudice Sobrinho
>



-- 
__

   David L. S.
dalss...@gmail.com
__


RE: Item Facet

2009-08-06 Thread Ge, Yao (Y.)
If you can reindex, simply rebuild the index with fields replaced by
combining existing fields. 
-Yao 

-Original Message-
From: David Lojudice Sobrinho [mailto:dalss...@gmail.com] 
Sent: Thursday, August 06, 2009 4:17 PM
To: solr-user@lucene.apache.org
Subject: Item Facet

Hi...

Is there any way to group values like shopping.yahoo.com or
shopper.cnet.com do?

For instance, I have documents like:

doc1 - product_name1 - value1
doc2 - product_name1 - value2
doc3 - product_name1 - value3
doc4 - product_name2 - value4
doc5 - product_name2 - value5
doc6 - product_name2 - value6

I'd like to have a result grouping by product name with the value
range per product. Something like:

product_name1 - (value1 to value3)
product_name2 - (value4 to value6)

It is not like the current facet because the information is grouped by
item, not the entire result.

Any idea?

Thanks!

David Lojudice Sobrinho


Item Facet

2009-08-06 Thread David Lojudice Sobrinho
Hi...

Is there any way to group values like shopping.yahoo.com or shopper.cnet.com do?

For instance, I have documents like:

doc1 - product_name1 - value1
doc2 - product_name1 - value2
doc3 - product_name1 - value3
doc4 - product_name2 - value4
doc5 - product_name2 - value5
doc6 - product_name2 - value6

I'd like to have a result grouping by product name with the value
range per product. Something like:

product_name1 - (value1 to value3)
product_name2 - (value4 to value6)

It is not like the current facet because the information is grouped by
item, not the entire result.

Any idea?

Thanks!

David Lojudice Sobrinho