[ 
https://issues.apache.org/jira/browse/SOLR-12325?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17023724#comment-17023724
 ] 

Munendra S N commented on SOLR-12325:
-------------------------------------

* When {{parentBitSet}} is null, we get NPE. {{parentBitSet}} could be null 
when uniqueBlock is used without blockjoin or on some invalid parent condition 
like {{type_s:book1}}. I think we could return 0 as count
* Other case is when there are {{NO_MORE_DOCS}}. This could happen if the given 
condition doesn't match all parent products For example, In tests, 
{{cat_s:fantasy}} should return count 1 instead of 2.

I would consider both cases as less likely scenarios but it would be great if 
we can handle them.

The patch introduces new aggregation for queries {{uniqueBlockQuery}}, I was 
thinking if it is possible to handle in the existing aggregation 
{{uniqueBlock}}. 

One thought was to introduce {{type}} argument. So, it would look like 
{{uniqueBlock(field, _root_)}} for field based aggregation and 
{{uniqueBlock(query, \{!v=type_s:book})}}. In future,this could be extended for 
function queries when supported is added, something like {{uniqueBlock(func, 
avg(something))}}.
For backward compatibility, when only one argument is passed, it would be 
treated as field aggregation.
This won't change the internal implementation but there won't be need for 
different aggregations for the users.

Above suggestion is a thought & have shared it as it is just to check if it 
makes sense or not. I think SOLR-14188 addresses this problem in general. 

Except those minor cases, other changes LGTM

> introduce uniqueBlockQuery(parent:true) aggregation for JSON Facet
> ------------------------------------------------------------------
>
>                 Key: SOLR-12325
>                 URL: https://issues.apache.org/jira/browse/SOLR-12325
>             Project: Solr
>          Issue Type: New Feature
>          Components: Facet Module
>            Reporter: Mikhail Khludnev
>            Assignee: Mikhail Khludnev
>            Priority: Major
>             Fix For: 8.5
>
>         Attachments: SOLR-12325.patch, SOLR-12325.patch, SOLR-12325.patch
>
>          Time Spent: 1.5h
>  Remaining Estimate: 0h
>
> It might be faster twin for {{uniqueBlock(\_root_)}}. Please utilise buildin 
> query parsing method, don't invent your own. 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org

Reply via email to