lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ian Smith" <>
Subject RE: How do I set up an embedded server with version 1.3.0 ?
Date Thu, 25 Jun 2009 11:11:11 GMT
From: Shalin Shekhar Mangar [] 
Sent: 25 June 2009 10:41
Subject: Re: How do I set up an embedded server with version 1.3.0 ?

On Thu, Jun 25, 2009 at 2:05 PM, Ian Smith

> Can you or someone else possibly help me with a working SolrCore 
> constructor call?
Here is a working example for single index/core:

        CoreContainer.Initializer initializer = new
        CoreContainer coreContainer = initializer.initialize();
        EmbeddedSolrServer server = new
EmbeddedSolrServer(coreContainer, "");
        SolrInputDocument doc = new SolrInputDocument();
        doc.addField("id", "101");
        server.commit(true, true);
        SolrQuery query = new SolrQuery();
        QueryResponse response = server.query(query);
        SolrDocumentList list = response.getResults();
        System.out.println("list.size() = " + list.size());

Make sure your dataDir in solrconfig.xml is fixed (absolute) otherwise
your data directory will get created relative to the current working
directory (or you could set a system property for

Hope that helps. I'll add it to the wiki too.
Shalin Shekhar Mangar.

Fantastic, I now have the embedded server working, thank you!

PS. Sorry about all the huge sigs, I don't have the facility to suppress
them from work, I'll post from a webmail account in future . . .


Website Content Management

Tamar Science Park, 15 Research Way, Plymouth, PL6 8BT

Save a tree, think before printing this email.

This email contains proprietary information, some or all of which may be legally privileged.
It is for the intended recipient only. If an addressing or transmission error has misdirected
this email, please notify the author by replying to this email. If you are not the intended
recipient you may not use, disclose, distribute, copy, print or rely on this email. 

Email transmission cannot be guaranteed to be secure or error free, as information may be
intercepted, corrupted, lost, destroyed, arrive late or incomplete or contain viruses. This
email and any files attached to it have been checked with virus detection software before
transmission. You should nonetheless carry out your own virus check before opening any attachment.
GOSS Interactive Ltd accepts no liability for any loss or damage that may be caused by software
Registered Office: c/o Bishop Fleming, Cobourg House, Mayflower Street, Plymouth, PL1 1LG.
 Company Registration No: 3553908  

View raw message