List of usage examples for org.apache.solr.client.solrj.embedded EmbeddedSolrServer getById
public SolrDocument getById(String collection, String id) throws SolrServerException, IOException
From source file:fr.jetoile.hadoopunit.component.SolrBootstrapTest.java
License:Apache License
@Test public void solrShouldStart() throws Exception { EmbeddedSolrServer client = ((SolrBootstrap) HadoopBootstrap.INSTANCE.getService(Component.SOLR)) .getClient();/*w w w .ja v a 2 s . c om*/ injectIntoSolr(client); SolrDocument collection1 = client .getById(configuration.getString(SolrBootstrap.SOLR_COLLECTION_INTERNAL_NAME), "book-1"); assertNotNull(collection1); assertThat(collection1.getFieldValue("name")).isEqualTo("The Legend of the Hobbit part 1"); }