You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Neeraj Lajpal <ne...@outlook.com> on 2016/02/15 14:09:57 UTC

solr-4.3.1 docValues usage

Hi,
I recently asked this question on stackoverflow:
I am trying to access a field in custom request handler. I am accessing it like this for each document:
Document doc;doc = reader.document(id);DocFields = doc.getValues("state");There are around 600,000 documents in the solr. For a query running on all the docs, it is taking more than 65 seconds.
I have also tried SolrIndexSearcher.doc method, but it is also taking around 60 seconds.
Removing the above lines of code bring down the qtime to milliseconds. But, I need to access that field for my algo.
Is there a more optimised way to do this?



In reply, I got a suggestion to use docValues. I read about it and it seems to be useful for my case. But, I am unable to find/figure out how to use it in my custom request handler.
Please tell me if there is some function/api to access a docValue field from custom handler, that takes input the doc-id and field.
Thanks,Neeraj Lajpal 		 	   		  

Re: solr-4.3.1 docValues usage

Posted by Emir Arnautovic <em...@sematext.com>.
Sorry - replied to wrong thread :(

On 15.02.2016 15:17, Emir Arnautovic wrote:
> Hi,
> Not  sure how ordering will help (maybe missing question) but what 
> seems to me that would help your case is simple boosting. See 
> https://wiki.apache.org/solr/SolrRelevancyFAQ#How_can_I_make_.22superman.22_in_the_title_field_score_higher_than_in_the_subject_field 
>
>
> Regards,
> Emir 

-- 
Monitoring * Alerting * Anomaly Detection * Centralized Log Management
Solr & Elasticsearch Support * http://sematext.com/


Re: solr-4.3.1 docValues usage

Posted by Emir Arnautovic <em...@sematext.com>.
Hi,
Not  sure how ordering will help (maybe missing question) but what seems 
to me that would help your case is simple boosting. See 
https://wiki.apache.org/solr/SolrRelevancyFAQ#How_can_I_make_.22superman.22_in_the_title_field_score_higher_than_in_the_subject_field

Regards,
Emir

On 15.02.2016 14:16, Binoy Dalal wrote:
> DocValues has nothing to do with your handler. It is a field property. To
> use it simply put docValues=true in your field definitions and reindex.
>
> On Mon, 15 Feb 2016, 18:40 Neeraj Lajpal <ne...@outlook.com> wrote:
>
>> Hi,
>> I recently asked this question on stackoverflow:
>> I am trying to access a field in custom request handler. I am accessing it
>> like this for each document:
>> Document doc;doc = reader.document(id);DocFields =
>> doc.getValues("state");There are around 600,000 documents in the solr. For
>> a query running on all the docs, it is taking more than 65 seconds.
>> I have also tried SolrIndexSearcher.doc method, but it is also taking
>> around 60 seconds.
>> Removing the above lines of code bring down the qtime to milliseconds.
>> But, I need to access that field for my algo.
>> Is there a more optimised way to do this?
>>
>>
>>
>> In reply, I got a suggestion to use docValues. I read about it and it
>> seems to be useful for my case. But, I am unable to find/figure out how to
>> use it in my custom request handler.
>> Please tell me if there is some function/api to access a docValue field
>> from custom handler, that takes input the doc-id and field.
>> Thanks,Neeraj Lajpal

-- 
Monitoring * Alerting * Anomaly Detection * Centralized Log Management
Solr & Elasticsearch Support * http://sematext.com/


Re: solr-4.3.1 docValues usage

Posted by Binoy Dalal <bi...@gmail.com>.
DocValues has nothing to do with your handler. It is a field property. To
use it simply put docValues=true in your field definitions and reindex.

On Mon, 15 Feb 2016, 18:40 Neeraj Lajpal <ne...@outlook.com> wrote:

> Hi,
> I recently asked this question on stackoverflow:
> I am trying to access a field in custom request handler. I am accessing it
> like this for each document:
> Document doc;doc = reader.document(id);DocFields =
> doc.getValues("state");There are around 600,000 documents in the solr. For
> a query running on all the docs, it is taking more than 65 seconds.
> I have also tried SolrIndexSearcher.doc method, but it is also taking
> around 60 seconds.
> Removing the above lines of code bring down the qtime to milliseconds.
> But, I need to access that field for my algo.
> Is there a more optimised way to do this?
>
>
>
> In reply, I got a suggestion to use docValues. I read about it and it
> seems to be useful for my case. But, I am unable to find/figure out how to
> use it in my custom request handler.
> Please tell me if there is some function/api to access a docValue field
> from custom handler, that takes input the doc-id and field.
> Thanks,Neeraj Lajpal

-- 
Regards,
Binoy Dalal

Re: solr-4.3.1 docValues usage

Posted by Neeraj Lajpal <ne...@outlook.com>.
Can someone please help me with this?
I am stuck for past few days.



> On 15-Feb-2016, at 6:39 PM, Neeraj Lajpal <ne...@outlook.com> wrote:
> 
> Hi,
> 
> I recently asked this question on stackoverflow:
> 
> I am trying to access a field in custom request handler. I am accessing it like this for each document:
> 
> Document doc;
> doc = reader.document(id);
> DocFields = doc.getValues("state");
> There are around 600,000 documents in the solr. For a query running on all the docs, it is taking more than 65 seconds.
> 
> I have also tried SolrIndexSearcher.doc method, but it is also taking around 60 seconds.
> 
> Removing the above lines of code bring down the qtime to milliseconds. But, I need to access that field for my algo.
> 
> Is there a more optimised way to do this?
> 
> 
> 
> 
> In reply, I got a suggestion to use docValues. I read about it and it seems to be useful for my case. But, I am unable to find/figure out how to use it in my custom request handler.
> 
> Please tell me if there is some function/api to access a docValue field from custom handler, that takes input the doc-id and field.
> 
> Thanks,
> Neeraj Lajpal


Re: solr-4.3.1 docValues usage

Posted by Mikhail Khludnev <mk...@griddynamics.com>.
Hello Neeraj,

Check slide 23 and overall
http://www.slideshare.net/lucenerevolution/what-is-inaluceneagrandfinal


On Mon, Feb 15, 2016 at 4:09 PM, Neeraj Lajpal <ne...@outlook.com> wrote:

> Hi,
> I recently asked this question on stackoverflow:
> I am trying to access a field in custom request handler. I am accessing it
> like this for each document:
> Document doc;doc = reader.document(id);DocFields =
> doc.getValues("state");There are around 600,000 documents in the solr. For
> a query running on all the docs, it is taking more than 65 seconds.
> I have also tried SolrIndexSearcher.doc method, but it is also taking
> around 60 seconds.
> Removing the above lines of code bring down the qtime to milliseconds.
> But, I need to access that field for my algo.
> Is there a more optimised way to do this?
>
>
>
> In reply, I got a suggestion to use docValues. I read about it and it
> seems to be useful for my case. But, I am unable to find/figure out how to
> use it in my custom request handler.
> Please tell me if there is some function/api to access a docValue field
> from custom handler, that takes input the doc-id and field.
> Thanks,Neeraj Lajpal




-- 
Sincerely yours
Mikhail Khludnev
Principal Engineer,
Grid Dynamics

<http://www.griddynamics.com>
<mk...@griddynamics.com>