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 Amel Fraisse <am...@gmail.com> on 2011/04/05 15:06:40 UTC

Different Result for the same query depending on using SolrServer or SolrCore ?

Hello every body,

I am using Solr for indexing and searching.

I am using 2 classes for searching document: In the first one I'm
instanciating a SolrServer to search documents as follows :

server = new EmbeddedSolrServer(coreContainer, "");
server.add(doc);
query.setQuery("id:"+idDoc);
server.query(query);

When I verify the result : it's OK. (I have 1 document in the docListResult)

In the second class I am using SolrCore for indexing and searching (because
I need 2 indexes) as follows:

servercore2 = new EmbeddedSolrServer(coreContainer, "core2");
servercore2.add(doc2);
query.setQuery("id:"+idDoc);
QueryResponse rsp = servercore2.query(query);


when I runnig this code : I have 0 documents in the result despite it's the
same request of the first class!!


Someone have met this problem ?

Thank you very much for your help.

Amel.