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

Vijay Sekhri commented on SOLR-5743:
------------------------------------

Hi Mikhail,
There were 2 reasons why the performance was bad I realized. 
a) For a whole lot of queries (internally generated by solr to different shards 
) you code was giving a NPE. That made our service layer get the exception and 
do another query that added up to the overall response times (QTime). The NPE 
was not happening on all queries though. However, whenever it would happen it 
would degrade the performance because of multiple queries. This is the code 
where it was happening 

{code}
14:00:20,751 ERROR [org.apache.solr.servlet.HttpSolrCall] 
(http-/10.235.43.43:8580-82) null:java.lang.NullPointerException
        at 
org.apache.solr.search.join.BlockJoinFacetCollector.incrementFacets(BlockJoinFacetCollector.java:100)
        at 
org.apache.solr.search.join.BlockJoinFacetCollector.collect(BlockJoinFacetCollector.java:87)
{code}
                
at this line 

{code}
 final int[] docNums = blockJoinScorer.swapChildDocs(childDocs);
{code}          

because sometime the blockJoinScorer object would be null.  Again this would 
happen half of the time but other half it would be fine. 

So I changed the code 
{code}          
    if(blockJoinScorer == null) {
        //System.out.println("blockJoinScorer is NULL");
        return;
    }
{code}          

and reran my load and it brought down performance back to 60 millisecond from 
200 milliseconds.

b) All my queries were doing a wild card match like this 
{code}          
q={!parent%20which=type_s:parent}id:*_child
{code}          


and I changed that to 
{code}          
q={!parent%20which=type_s:parent}type_s:child
{code}          

This further brought down the qTimes to 30 milliseconds. Granted it is a bit 
higher than baseline but it is acceptable. Please let me know what to do about 
that NPE in the code. I am not sure if what I did is functionally  correct or 
not. 

-regards

> Faceting with BlockJoin support
> -------------------------------
>
>                 Key: SOLR-5743
>                 URL: https://issues.apache.org/jira/browse/SOLR-5743
>             Project: Solr
>          Issue Type: New Feature
>          Components: faceting
>            Reporter: abipc
>            Assignee: Mikhail Khludnev
>              Labels: features
>             Fix For: 5.5, master
>
>         Attachments: SOLR-5743.patch, SOLR-5743.patch, SOLR-5743.patch, 
> SOLR-5743.patch, SOLR-5743.patch, SOLR-5743.patch, SOLR-5743.patch, 
> SOLR-5743.patch, SOLR-5743.patch, SOLR-5743.patch, SOLR-5743.patch, 
> SOLR-5743.patch, SOLR-5743.patch, SOLR-5743.patch, SOLR-5743.patch, 
> cluster.jpg, service_baseline.png, service_new_baseline.jpg, 
> solr_baseline.jpg, solr_new_baseline.jpg
>
>
> For a sample inventory(note - nested documents) like this -   
>  <doc>
> <field name="id">10</field>
> <field name="type_s">parent</field>
> <field name="BRAND_s">Nike</field>
> <doc>
> <field name="id">11</field>
> <field name="COLOR_s">Red</field>
> <field name="SIZE_s">XL</field>
> </doc>
> <doc>
> <field name="id">12</field>
> <field name="COLOR_s">Blue</field>
> <field name="SIZE_s">XL</field>
> </doc>
> </doc>
> Faceting results must contain - 
> Red(1)
> XL(1) 
> Blue(1) 
> for a "q=*" query. 
> PS : The inventory example has been taken from this blog - 
> http://blog.griddynamics.com/2013/09/solr-block-join-support.html



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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

Reply via email to