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 satyasundar jena <to...@gmail.com> on 2009/09/22 15:45:31 UTC

solr caching problem

I configured filter cache in solrconfig.xml as here under :
<filterCache
class="solr.FastLRUCache"
size="16384"
initialSize="4096"
autowarmCount="4096"/>

<useFilterForSortedQuery>true</useFilterForSortedQuery>

as per
http://wiki.apache.org/solr/SolrCaching#head-b6cccca7d51521d55fa0c89f2b576b2659f297f9

And executed a query as:
http://localhost:8080/solr/select/?q=*:*&fq=id:(172704<http://localhost:8080/solr/select/?q=*:*&fq=id:%28172704>TO
2079813)&sort=id asc

But when i deleted the doc id:172704 and executed the query again , i didnt
find the same doc(172704 ) in my
result.

Re: solr caching problem

Posted by Lance Norskog <go...@gmail.com>.
There are now two excellent books: "Lucene In Action 2" and "Solr 1.4
Enterprise Search Server" the describe the inners workings of these
technologies and how they fit together.

Otherwise Solr and Lucene knowledge are only available in a fragmented
form across many wiki pages, bug reports and email discussions.

But the direct answer is: before you commit your changes you will not
seem them in queries. When you commit them, all caches are thrown away
and rebuilt when you do the same queries you did before. This
rebuilding process has various tools to control it in solrconfig.xml.

On Wed, Sep 23, 2009 at 8:27 PM, satya <to...@gmail.com> wrote:
> Is there any way to analyze or see that which documents are getting cached
> by documentCache -
>
>  <documentCache
>     class="solr.LRUCache"
>     size="512"
>     initialSize="512"
>     autowarmCount="0"/>
>
>
>
> On Wed, Sep 23, 2009 at 8:10 AM, satya <to...@gmail.com> wrote:
>
>> First of all , thanks a lot for the clarification.Is there any way to see,
>> how this cache is working internally and what are the objects being stored
>> and how much memory its consuming,so that we can get a clear picture in
>> mind.And how to test the performance through cache.
>>
>>
>> On Tue, Sep 22, 2009 at 11:19 PM, Fuad Efendi <fu...@efendi.ca> wrote:
>>
>>> > 1)Then do you mean , if we delete a perticular doc ,then that is going
>>> to
>>> be
>>> > deleted from
>>> >   cache also.
>>>
>>> When you delete document, and then COMMIT your changes, new caches will be
>>> warmed up (and prepopulated by some key-value pairs from old instances),
>>> etc:
>>>
>>>  <!-- documentCache caches Lucene Document objects (the stored fields for
>>> each document).
>>>       Since Lucene internal document ids are transient, this cache will
>>> not
>>> be autowarmed.  -->
>>>    <documentCache
>>>      class="solr.LRUCache"
>>>      size="512"
>>>      initialSize="512"
>>>      autowarmCount="0"/>
>>>
>>> - this one won't be 'prepopulated'.
>>>
>>>
>>>
>>>
>>> > 2)In solr,is  cache storing the entire document in memory or only the
>>> > references to
>>> >    documents in memory.
>>>
>>> There are many different cache instances, DocumentCache should store <ID,
>>> Document> pairs, etc....
>>>
>>>
>>>
>>
>



-- 
Lance Norskog
goksron@gmail.com

Re: solr caching problem

Posted by satya <to...@gmail.com>.
Is there any way to analyze or see that which documents are getting cached
by documentCache -

  <documentCache
     class="solr.LRUCache"
     size="512"
     initialSize="512"
     autowarmCount="0"/>



On Wed, Sep 23, 2009 at 8:10 AM, satya <to...@gmail.com> wrote:

> First of all , thanks a lot for the clarification.Is there any way to see,
> how this cache is working internally and what are the objects being stored
> and how much memory its consuming,so that we can get a clear picture in
> mind.And how to test the performance through cache.
>
>
> On Tue, Sep 22, 2009 at 11:19 PM, Fuad Efendi <fu...@efendi.ca> wrote:
>
>> > 1)Then do you mean , if we delete a perticular doc ,then that is going
>> to
>> be
>> > deleted from
>> >   cache also.
>>
>> When you delete document, and then COMMIT your changes, new caches will be
>> warmed up (and prepopulated by some key-value pairs from old instances),
>> etc:
>>
>>  <!-- documentCache caches Lucene Document objects (the stored fields for
>> each document).
>>       Since Lucene internal document ids are transient, this cache will
>> not
>> be autowarmed.  -->
>>    <documentCache
>>      class="solr.LRUCache"
>>      size="512"
>>      initialSize="512"
>>      autowarmCount="0"/>
>>
>> - this one won't be 'prepopulated'.
>>
>>
>>
>>
>> > 2)In solr,is  cache storing the entire document in memory or only the
>> > references to
>> >    documents in memory.
>>
>> There are many different cache instances, DocumentCache should store <ID,
>> Document> pairs, etc....
>>
>>
>>
>

Re: solr caching problem

Posted by satya <to...@gmail.com>.
First of all , thanks a lot for the clarification.Is there any way to see,
how this cache is working internally and what are the objects being stored
and how much memory its consuming,so that we can get a clear picture in
mind.And how to test the performance through cache.

On Tue, Sep 22, 2009 at 11:19 PM, Fuad Efendi <fu...@efendi.ca> wrote:

> > 1)Then do you mean , if we delete a perticular doc ,then that is going to
> be
> > deleted from
> >   cache also.
>
> When you delete document, and then COMMIT your changes, new caches will be
> warmed up (and prepopulated by some key-value pairs from old instances),
> etc:
>
>  <!-- documentCache caches Lucene Document objects (the stored fields for
> each document).
>       Since Lucene internal document ids are transient, this cache will not
> be autowarmed.  -->
>    <documentCache
>      class="solr.LRUCache"
>      size="512"
>      initialSize="512"
>      autowarmCount="0"/>
>
> - this one won't be 'prepopulated'.
>
>
>
>
> > 2)In solr,is  cache storing the entire document in memory or only the
> > references to
> >    documents in memory.
>
> There are many different cache instances, DocumentCache should store <ID,
> Document> pairs, etc....
>
>
>

RE: solr caching problem

Posted by Fuad Efendi <fu...@efendi.ca>.
> 1)Then do you mean , if we delete a perticular doc ,then that is going to
be
> deleted from
>   cache also.

When you delete document, and then COMMIT your changes, new caches will be
warmed up (and prepopulated by some key-value pairs from old instances),
etc:

  <!-- documentCache caches Lucene Document objects (the stored fields for
each document).
       Since Lucene internal document ids are transient, this cache will not
be autowarmed.  -->
    <documentCache
      class="solr.LRUCache"
      size="512"
      initialSize="512"
      autowarmCount="0"/>

- this one won't be 'prepopulated'.




> 2)In solr,is  cache storing the entire document in memory or only the
> references to
>    documents in memory.

There are many different cache instances, DocumentCache should store <ID,
Document> pairs, etc....



Re: solr caching problem

Posted by satyasundar jena <to...@gmail.com>.
1)Then do you mean , if we delete a perticular doc ,then that is going to be
deleted from
  cache also.
2)In solr,is  cache storing the entire document in memory or only the
references to
   documents in memory.
And how to test this caching after all.
I ll be thankful upon getting an elaboration.

On Tue, Sep 22, 2009 at 8:46 PM, Yonik Seeley <yo...@lucidimagination.com>wrote:

> Solr's caches should be transparent - they should only speed up
> queries, not change the result of queries.
>
> -Yonik
> http://www.lucidimagination.com
>
> On Tue, Sep 22, 2009 at 9:45 AM, satyasundar jena <to...@gmail.com>
> wrote:
> > I configured filter cache in solrconfig.xml as here under :
> > <filterCache
> > class="solr.FastLRUCache"
> > size="16384"
> > initialSize="4096"
> > autowarmCount="4096"/>
> >
> > <useFilterForSortedQuery>true</useFilterForSortedQuery>
> >
> > as per
> >
> http://wiki.apache.org/solr/SolrCaching#head-b6cccca7d51521d55fa0c89f2b576b2659f297f9
> >
> > And executed a query as:
> > http://localhost:8080/solr/select/?q=*:*&fq=id:(172704<http://localhost:8080/solr/select/?q=*:*&fq=id:%28172704>
> <http://localhost:8080/solr/select/?q=*:*&fq=id:%28172704>TO
> > 2079813)&sort=id asc
> >
> > But when i deleted the doc id:172704 and executed the query again , i
> didnt
> > find the same doc(172704 ) in my
> > result.
> >
>

Re: solr caching problem

Posted by Yonik Seeley <yo...@lucidimagination.com>.
Solr's caches should be transparent - they should only speed up
queries, not change the result of queries.

-Yonik
http://www.lucidimagination.com

On Tue, Sep 22, 2009 at 9:45 AM, satyasundar jena <to...@gmail.com> wrote:
> I configured filter cache in solrconfig.xml as here under :
> <filterCache
> class="solr.FastLRUCache"
> size="16384"
> initialSize="4096"
> autowarmCount="4096"/>
>
> <useFilterForSortedQuery>true</useFilterForSortedQuery>
>
> as per
> http://wiki.apache.org/solr/SolrCaching#head-b6cccca7d51521d55fa0c89f2b576b2659f297f9
>
> And executed a query as:
> http://localhost:8080/solr/select/?q=*:*&fq=id:(172704<http://localhost:8080/solr/select/?q=*:*&fq=id:%28172704>TO
> 2079813)&sort=id asc
>
> But when i deleted the doc id:172704 and executed the query again , i didnt
> find the same doc(172704 ) in my
> result.
>