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 Li Li <fa...@gmail.com> on 2010/10/11 10:54:54 UTC

question about SolrCore

hi all,
    I want to know the detail of IndexReader in SolrCore. I read a
little codes of SolrCore. Here is my understanding, are they correct?
    Each SolrCore has many SolrIndexSearcher and keeps them in
_searchers. and _searcher keep trace of the latest version of index.
Each SolrIndexSearcher has a SolrIndexReader. If there isn't any
update, all these searchers share one single SolrIndexReader. If there
is an update, then a newSearcher will be created and a new
SolrIndexReader associated with it.
    I did a simple test.
    A thread do a query and blocked by breakpoint. Then I feed some
data to update index. When commit, a newSearcher is created.
    Here is the debug info:

    SolrCore _searcher [SolrIndexSearcher@...ab]

_searchers[SolrIndexSearcher@...77,SolrIndexSearcher@...ab,SolrIndexSearcher@..f8]
                 SolrIndexSearcher@...77 's SolrIndexReader is old one
and     ab and f8 share the same newest SolrIndexReader
    When query finished SolrIndexSearcher@...77 is discarded. When
newSearcher success to warmup, There is only one SolrIndexSearcher.
    The SolrIndexReader of old version of index is discarded and only
segments in newest SolrIndexReader are referenced. Those segments not
in new version can then be deleted because no file pointer reference
them
.
    Then I start 3 queries. There is only one SolrIndexSearcher but RefCount=4.
    It seems many search can share one single SolrIndexSearcher.
    So in which situation, there will exist more than one
SolrIndexSearcher that they share just one SolrIndexReader?
    Another question, for each version of index, is there just one
SolrIndexReader instance associated with it? will it occur that more
than one SolrIndexReader are opened and they are the same version of
index?

Re: question about SolrCore

Posted by Erick Erickson <er...@gmail.com>.
Why do you want to know? If there is a specific problem you're
trying to solve, perhaps stating the problem itself will get you a
better response.

Best
Erick

On Thu, Oct 28, 2010 at 4:00 AM, Li Li <fa...@gmail.com> wrote:

> is there anyone could help me?
>
> 2010/10/11 Li Li <fa...@gmail.com>:
> > hi all,
> >    I want to know the detail of IndexReader in SolrCore. I read a
> > little codes of SolrCore. Here is my understanding, are they correct?
> >    Each SolrCore has many SolrIndexSearcher and keeps them in
> > _searchers. and _searcher keep trace of the latest version of index.
> > Each SolrIndexSearcher has a SolrIndexReader. If there isn't any
> > update, all these searchers share one single SolrIndexReader. If there
> > is an update, then a newSearcher will be created and a new
> > SolrIndexReader associated with it.
> >    I did a simple test.
> >    A thread do a query and blocked by breakpoint. Then I feed some
> > data to update index. When commit, a newSearcher is created.
> >    Here is the debug info:
> >
> >    SolrCore _searcher [SolrIndexSearcher@...ab]
> >
> > _searchers[SolrIndexSearcher@...77,SolrIndexSearcher@
> ...ab,SolrIndexSearcher@..f8]
> >                 SolrIndexSearcher@...77 's SolrIndexReader is old one
> > and     ab and f8 share the same newest SolrIndexReader
> >    When query finished SolrIndexSearcher@...77 is discarded. When
> > newSearcher success to warmup, There is only one SolrIndexSearcher.
> >    The SolrIndexReader of old version of index is discarded and only
> > segments in newest SolrIndexReader are referenced. Those segments not
> > in new version can then be deleted because no file pointer reference
> > them
> > .
> >    Then I start 3 queries. There is only one SolrIndexSearcher but
> RefCount=4.
> >    It seems many search can share one single SolrIndexSearcher.
> >    So in which situation, there will exist more than one
> > SolrIndexSearcher that they share just one SolrIndexReader?
> >    Another question, for each version of index, is there just one
> > SolrIndexReader instance associated with it? will it occur that more
> > than one SolrIndexReader are opened and they are the same version of
> > index?
> >
>

Re: question about SolrCore

Posted by Li Li <fa...@gmail.com>.
is there anyone could help me?

2010/10/11 Li Li <fa...@gmail.com>:
> hi all,
>    I want to know the detail of IndexReader in SolrCore. I read a
> little codes of SolrCore. Here is my understanding, are they correct?
>    Each SolrCore has many SolrIndexSearcher and keeps them in
> _searchers. and _searcher keep trace of the latest version of index.
> Each SolrIndexSearcher has a SolrIndexReader. If there isn't any
> update, all these searchers share one single SolrIndexReader. If there
> is an update, then a newSearcher will be created and a new
> SolrIndexReader associated with it.
>    I did a simple test.
>    A thread do a query and blocked by breakpoint. Then I feed some
> data to update index. When commit, a newSearcher is created.
>    Here is the debug info:
>
>    SolrCore _searcher [SolrIndexSearcher@...ab]
>
> _searchers[SolrIndexSearcher@...77,SolrIndexSearcher@...ab,SolrIndexSearcher@..f8]
>                 SolrIndexSearcher@...77 's SolrIndexReader is old one
> and     ab and f8 share the same newest SolrIndexReader
>    When query finished SolrIndexSearcher@...77 is discarded. When
> newSearcher success to warmup, There is only one SolrIndexSearcher.
>    The SolrIndexReader of old version of index is discarded and only
> segments in newest SolrIndexReader are referenced. Those segments not
> in new version can then be deleted because no file pointer reference
> them
> .
>    Then I start 3 queries. There is only one SolrIndexSearcher but RefCount=4.
>    It seems many search can share one single SolrIndexSearcher.
>    So in which situation, there will exist more than one
> SolrIndexSearcher that they share just one SolrIndexReader?
>    Another question, for each version of index, is there just one
> SolrIndexReader instance associated with it? will it occur that more
> than one SolrIndexReader are opened and they are the same version of
> index?
>

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


Re: question about SolrCore

Posted by Li Li <fa...@gmail.com>.
is there anyone could help me?

2010/10/11 Li Li <fa...@gmail.com>:
> hi all,
>    I want to know the detail of IndexReader in SolrCore. I read a
> little codes of SolrCore. Here is my understanding, are they correct?
>    Each SolrCore has many SolrIndexSearcher and keeps them in
> _searchers. and _searcher keep trace of the latest version of index.
> Each SolrIndexSearcher has a SolrIndexReader. If there isn't any
> update, all these searchers share one single SolrIndexReader. If there
> is an update, then a newSearcher will be created and a new
> SolrIndexReader associated with it.
>    I did a simple test.
>    A thread do a query and blocked by breakpoint. Then I feed some
> data to update index. When commit, a newSearcher is created.
>    Here is the debug info:
>
>    SolrCore _searcher [SolrIndexSearcher@...ab]
>
> _searchers[SolrIndexSearcher@...77,SolrIndexSearcher@...ab,SolrIndexSearcher@..f8]
>                 SolrIndexSearcher@...77 's SolrIndexReader is old one
> and     ab and f8 share the same newest SolrIndexReader
>    When query finished SolrIndexSearcher@...77 is discarded. When
> newSearcher success to warmup, There is only one SolrIndexSearcher.
>    The SolrIndexReader of old version of index is discarded and only
> segments in newest SolrIndexReader are referenced. Those segments not
> in new version can then be deleted because no file pointer reference
> them
> .
>    Then I start 3 queries. There is only one SolrIndexSearcher but RefCount=4.
>    It seems many search can share one single SolrIndexSearcher.
>    So in which situation, there will exist more than one
> SolrIndexSearcher that they share just one SolrIndexReader?
>    Another question, for each version of index, is there just one
> SolrIndexReader instance associated with it? will it occur that more
> than one SolrIndexReader are opened and they are the same version of
> index?
>