<<I am not sure, what you mean with "multi-user"-scenario.>> I have an application deployed on an application server (Weblogic). This application uses solr to query an index. Users (sessions) will log in to the application, query and then log out. This login and logout has nothing to do with solr but the application manages them separately. I am using EmbeddedSolrServer here.
I think I know where my mistake is. From what you say, it looks to me as though that I should not create a new SolrIndexSearcher object because Solr will do this automatically. In my current implementation, I am explicitly creating a new SolrIndexSearcher object for every new user who logs into the application. Let me provide a code snippet to explain further. This is how I initialize the solr handles required for searching. I am using EmbeddedSolrServer. SolrConfig solrConfig = new SolrConfig(configHome+"/solrconfig.xml"); IndexSchema indexSchema = new IndexSchema(solrConfig, configHome+"/schema.xml", null); File corefile = new File(coreHome, "solr.xml"); CoreContainer coreContainer = new CoreContainer(coreHome, corefile); CoreDescriptor coreDescriptor = new CoreDescriptor(coreContainer, coreName, solrConfig.getResourceLoader().getInstanceDir()); coreDescriptor.setConfigName(solrConfig.getResourceName()); coreDescriptor.setSchemaName(indexSchema.getResourceName()); SolrCore solrCore = new SolrCore(coreName, indexHome, solrConfig, indexSchema, coreDescriptor); coreContainer.register(coreName, solrCore, false); SolrServer solrServer = new EmbeddedSolrServer( coreContainer, coreName ); //Next two lines executed for every user SolrIndexSearcher solrSearcher = solrCore.newSearcher("s1"); SolrRequestParsers solrRequestParsers = new SolrRequestParsers(solrConfig); Many thanks for the response(s). Regards Rahul On Mon, May 24, 2010 at 1:55 AM, MitchK <mitc...@web.de> wrote: > > > > > In my case, I have an index which will not be modified after creation. > > Does > > this mean that in a multi-user scenario, I can have a static > IndexSearcher > > object that can be shared by multiple users ? > > > I am not sure, what you mean with "multi-user"-scenario. Can you tell me > what you got in mind? > If your index never changes, your IndexSearcher won't change. > > > > > > If the IndexSearcher object is threadsafe, then only issues related to > > concurrency are addressed. What about the case where the IndexSearcher is > > static? User 1 logs in to the system, queries with the static > > IndexSearcher, > > logs out; and then User 2 logs in to the system, queries with the same > > static IndexSearcher, logs out. In this case, the users 1 and 2 are not > > querying concurrently but one after another. Will the query information > > (filters or any other data) of User 1 be retained when User 2 uses this ? > > > I am not sure about the benefit of a static IndexSearcher. What do you > hope??? > > If user 1 uses a filter like "fq=name:Samuel&q=somethingIWantToKnow" and > user 2 queries for "fq=name:Samuel&q=whatIReallyWantToKnow" than they use > the same cached filter-object, retrived from Solr's internal cache (of > course you need to have a cache-size that allows cacheing). > > > > > The solr wiki states that the caches are per IndexSearcher object i.e if > I > > set my filterCache size to 1000 it means that 1000 entries can be > assigned > > for every IndexSearcher object. > > > Yes. If a new searcher is created than the new Cache is built on the old > one. > > > > > Is this true for queryResultsCache, > > filterCache and documentCache ? > > > For FilterCache it's true. For queryResultsCache (if I understand the wiki > right), too. > Please note, that the documentCache's behaviour is different from the > already mentioned ones. > The wiki says: > > > > Note: This cache cannot be used as a source for autowarming because > > document IDs will change when anything in the index changes so they can't > > be used by a new searcher. > > > > The wiki says that the number of the document cache should not be bigger > than the number of _results_ * number of _concurrent_ queries. > I never worked with the document cache, so maybe someone else can throw > some > light into the dark. > But from what I have understood it means the following: > > If you show 10 results per request and you think of up to 500 concurrent > queries: > 10 * 500 => 5000 > > But I want to emphasize, that this is only a gues. I actually don't exactly > know more about this topic. > > Kind regards > - Mitch > -- > View this message in context: > http://lucene.472066.n3.nabble.com/IndexSearcher-and-Caches-tp833567p838367.html > Sent from the Solr - User mailing list archive at Nabble.com. >