[
https://issues.apache.org/jira/browse/LUCENE-3097?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13033865#comment-13033865
]
Bill Bell commented on LUCENE-3097:
-----------------------------------
Here is another example...
Doctors have multiple offices. I want to store doctorid, doctor's name, gender
(male/female), and office address as separate rows. Then I want to group by
doctorid. I only want the one doctor. I then want to facet by gender and see
the numbers after it is grouped. I also want the total rows to be after
grouping.
doctorid, doctor's name, gender, address
1, Bill Bell, male, 55 east main St
1, Bill Bell, male, 103 E 5th St
2, Sue Jones, female, 67 W 97th St
2, Sue Jones, female, 888 O'West St
3, Toby Williams, male, 8 Vale St
4, Margie Youth, female, 5 E Medical Center
4, Margie Youth, female, 98456 E Rose St
I would expect the grouping to return:
total rows = 7
group total rows = 4
group_by
1,
Bill Bell, male, 55 east main St
Bill Bell, male, 103 E 5th St
2,
Sue Jones, female, 67 W 97th St
Sue Jones, female, 888 O'West St
3,
Toby Williams, male, 8 Vale St
4,
Margie Youth, female, 5 E Medical Center
Margie Youth, female, 98456 E Rose St
I would expect if I say, rows=2, start=0, order by doctorid, I would get:
1,
Bill Bell, male, 55 east main St
Bill Bell, male, 103 E 5th St
2,
Sue Jones, female, 67 W 97th St
Sue Jones, female, 888 O'West St
If I say, facet.field=gender I would expect:
male: 2 (Bill Bell, Toby Williams)
female: 2 (Sue Jones, Margie Youth)
If we had Spatial, and I had lat long for each address, I would expect if I say
sort=geodist() asc that it would group and then find the closest
point for each grouping to return in the proper order. For example, if I was at
103 E 5th St, I would expect the output for doctorid=1 to be:
group_by
1,
Bill Bell, male, 103 E 5th St
Bill Bell, male, 55 east main St
If I only need the 1st point in the grouping I would expect the other points to
be omitted.
group_by
1,
Bill Bell, male, 103 E 5th St
2,
Sue Jones, female, 67 W 97th St
3,
Toby Williams, male, 8 Vale St
4,
Margie Youth, female, 5 E Medical Center
Thanks.
> Post grouping faceting
> ----------------------
>
> Key: LUCENE-3097
> URL: https://issues.apache.org/jira/browse/LUCENE-3097
> Project: Lucene - Java
> Issue Type: New Feature
> Reporter: Martijn van Groningen
> Priority: Minor
> Fix For: 3.2, 4.0
>
>
> This issues focuses on implementing post grouping faceting.
> * How to handle multivalued fields. What field value to show with the facet.
> * Where the facet counts should be based on
> ** Facet counts can be based on the normal documents. Ungrouped counts.
> ** Facet counts can be based on the groups. Grouped counts.
> ** Facet counts can be based on the combination of group value and facet
> value. Matrix counts.
> And properly more implementation options.
> The first two methods are implemented in the SOLR-236 patch. For the first
> option it calculates a DocSet based on the individual documents from the
> query result. For the second option it calculates a DocSet for all the most
> relevant documents of a group. Once the DocSet is computed the FacetComponent
> and StatsComponent use one the DocSet to create facets and statistics.
> This last one is a bit more complex. I think it is best explained with an
> example. Lets say we search on travel offers:
> |||hotel||departure_airport||duration||
> |Hotel a|AMS|5
> |Hotel a|DUS|10
> |Hotel b|AMS|5
> |Hotel b|AMS|10
> If we group by hotel and have a facet for airport. Most end users expect
> (according to my experience off course) the following airport facet:
> AMS: 2
> DUS: 1
> The above result can't be achieved by the first two methods. You either get
> counts AMS:3 and DUS:1 or 1 for both airports.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]