mirror of https://github.com/apache/lucene.git
using normal "add" command
git-svn-id: https://svn.apache.org/repos/asf/lucene/solr/trunk@553575 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
3fd423d27a
commit
1d3418e0d3
|
@ -161,8 +161,6 @@ abstract public class SolrExampleTestBase extends AbstractSolrTestCase
|
|||
*/
|
||||
public void testAddRetrieve() throws Exception
|
||||
{
|
||||
String path = "/update";
|
||||
|
||||
SolrServer server = getSolrServer();
|
||||
|
||||
// Empty the database...
|
||||
|
@ -184,10 +182,7 @@ abstract public class SolrExampleTestBase extends AbstractSolrTestCase
|
|||
docs.add( doc2 );
|
||||
|
||||
// Add the documents
|
||||
UpdateRequest up = new UpdateRequest();
|
||||
up.setPath( path );
|
||||
up.add( docs );
|
||||
server.request( up );
|
||||
server.add( docs );
|
||||
server.commit();
|
||||
|
||||
SolrQuery query = new SolrQuery();
|
||||
|
@ -195,18 +190,15 @@ abstract public class SolrExampleTestBase extends AbstractSolrTestCase
|
|||
query.addSortField( "price", SolrQuery.ORDER.asc );
|
||||
QueryResponse rsp = server.query( query );
|
||||
|
||||
Assert.assertEquals( path, 2, rsp.getResults().getNumFound() );
|
||||
Assert.assertEquals( 2, rsp.getResults().getNumFound() );
|
||||
System.out.println( rsp.getResults() );
|
||||
|
||||
// Now do it again
|
||||
up = new UpdateRequest();
|
||||
up.setPath( path );
|
||||
up.add( docs );
|
||||
server.request( up );
|
||||
server.add( docs );
|
||||
server.commit();
|
||||
|
||||
rsp = server.query( query );
|
||||
Assert.assertEquals( path, 2, rsp.getResults().getNumFound() );
|
||||
Assert.assertEquals( 2, rsp.getResults().getNumFound() );
|
||||
System.out.println( rsp.getResults() );
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue