lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Daulet Kadirbekov (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (SOLR-6802) Solr AnalyticsQuery API returns analytics by documents that don't match query
Date Thu, 27 Nov 2014 12:22:12 GMT

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

Daulet Kadirbekov commented on SOLR-6802:
-----------------------------------------

Solr AnalyticsQuery API returns analytics by documents that don't match query.

I have core named 'documents' in Solr. There are some fields like 'id', 'url', 'text', 'domain'.
Also I have ResourceAnalyticsCollector which counts how many documents belongs to each resource.
Example of result of resource analytics is:

resources:{

example.com: 456
example2.com: 123
...
}

First time I found problem when the query was by one domain but analytics returned result
with few domains.

Example:

Solr query: domain:example.com

Number of documents returned by this query: 1000(All this documents belongs to example.com)

Analytics result:

resources:{

example.com: 700
example2.com: 100
example3.com: 100
example4.com: 100
}

I looked for all documents by /select search handler and all of this documents was belonged
to example.com domain.

But when I looked in analytics for documents, I have found that there are many documents which
don't match query. But number of documents is the same.

Here is my analytics module:
public class ResourceAnalyticsCollector extends DelegatingCollector{

    public ResourceAnalyticsCollector(ResponseBuilder rb, IndexSearcher searcher) {
        this.rb = rb;
        this.searcher = searcher;
    }

    @Override
    public void collect(int docNum){
        Document doc;
        doc = searcher.doc(docNum);

             //Output document id for logs
        String docId = doc.get(AnalyticsConstants.ID_SOLR_FIELD);
        System.out.println("Doc id = " + docId);

        documentList.add(doc);
        delegate.collect(docNum);
    }

    @Override
    public void finish(){
        rb.rsp.add(TOTAL_RESULT_FIELD, this.getAnalyticsContext(documentList));
    }

Original text: http://stackoverflow.com/questions/27164634/solr-analyticsquery-api-returns-analytics-by-documents-that-dont-match-query

> Solr AnalyticsQuery API returns analytics by documents that don't match query
> -----------------------------------------------------------------------------
>
>                 Key: SOLR-6802
>                 URL: https://issues.apache.org/jira/browse/SOLR-6802
>             Project: Solr
>          Issue Type: Bug
>          Components: query parsers
>    Affects Versions: 4.10.2
>            Reporter: Daulet Kadirbekov
>            Priority: Critical
>
> Solr AnalyticsQuery API returns analytics by documents that don't match query.
> Example:
> Solr query: domain:example.com
> I looked for all documents by /select search handler and all of this documents was belonged
to example.com domain.
> But when I looked in analytics for documents, I have found that there are many documents
which don't match query. But number of documents is the same.



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

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


Mime
View raw message