On Wed, Mar 11, 2009 at 6:37 PM, Kulkarni, Ajit Kamalakar <
ajkulka...@ptc.com> wrote:

>
> If we index the documents using CommonsHttpSolrServer and search using
> the same, we get the updated results
>
> That means we can search the latest added document as well even if it is
> not committed to the file system
>

That is not possible. Without calling commit, new documents will not be
visible to a searcher.


> So it looks like there is some kind of cache that is used by both index
> and search logic inside solr for a given SolrServer components (e. g.
> CommonsHttpSolrServer, EmbeddedSolrServer)
>

Indexing does not create any cache. The caching is done only by the
searcher. The old searcher/cache is discarded and a new searcher/cache is
created when you call commit. Setting autoWarmCount on the caches in
solrconfig.xml makes the new searcher run some of the most recently used
queries on the old searcher to warm up the new cache.

Calling commit on the SolrServer to synch with the index data may not be
> good option as I suppose it to be expensive operation.
>

It is the only option. But you may be able to make the operation cheaper by
tweaking the autowarmCount on the caches (this is specified in
solrconfig.xml). However, caches are important for good search performance.
Depending on your search traffic, you'll need to find a sweet spot.


> The cache and hard disk data synchronization should be independent of
> the SolrServer instances managed by Solr Web Application inside tomcat.
>

SolrServer is not really a server in itself. It is (a pointer to?) a server
being used by a solrj client. The CommonsHttpSolrServer refers to a remote
server url and makes calls through HTTP. SolrCore is the internal class
which manages the state of the server.

A SolrCore is created by the solr webapp. When you create another SolrCore
for use by EmbeddedSolrServer, they do not know about each other. Therefore
you need to notify it if you change the index through another core.


> The issue still will be that EmbeddedSolrServer may directly access hard
> index data as it may bypass the Solr web app totally
>
> I am embedding tomcat in my RMI server.
>
> The RMI Server is going to use EmbeddedSolrServer and it also hosts the
> Solr WebApp inside its tomcat instance
>
> So I guess I should be able to manage a singleton cache  that is given
> to both, CommonsHttpSolrServer related components managed inside Solr
> WebApp and EmbeddedSolrServer components
>
>
Why have two of them at all? Is the solr deployed inside tomcat serves HTTP
requests from external clients without going through your RMI server? You
can simplify things by keeping it either in tomcat or in embedded mode.

Hope that helps.

-- 
Regards,
Shalin Shekhar Mangar.

Reply via email to