mirror of https://github.com/apache/lucene.git
SOLR-352: remove duplicated commit and optimize
git-svn-id: https://svn.apache.org/repos/asf/lucene/solr/trunk@574608 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
7f54a7c94e
commit
14e8c34757
|
@ -169,24 +169,9 @@ public class UpdateRequest extends RequestBase
|
|||
writer.append( "</delete>" );
|
||||
}
|
||||
|
||||
// add the commits
|
||||
if (action == ACTION.COMMIT) {
|
||||
writer.append("<commit ");
|
||||
writer.append("waitFlush=\"" + waitFlush + "\" ");
|
||||
writer.append("waitSearcher=\"" + waitSearcher + "\" ");
|
||||
writer.append(">");
|
||||
writer.append("</commit>");
|
||||
}
|
||||
|
||||
// add the optimizes
|
||||
if (action == ACTION.OPTIMIZE) {
|
||||
writer.append("<optimize ");
|
||||
writer.append("waitFlush=\"" + waitFlush + "\" ");
|
||||
writer.append("waitSearcher=\"" + waitSearcher + "\" ");
|
||||
writer.append(">");
|
||||
writer.append("</optimize>");
|
||||
}
|
||||
return writer.toString();
|
||||
// If action is COMMIT or OPTIMIZE, it is sent with params
|
||||
String xml = writer.toString();
|
||||
return (xml.length() > 0) ? xml : null;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
|
|
|
@ -56,9 +56,12 @@ public class ClientUtils
|
|||
*/
|
||||
public static Collection<ContentStream> toContentStreams( final String str, final String contentType )
|
||||
{
|
||||
if( str == null )
|
||||
return null;
|
||||
|
||||
ArrayList<ContentStream> streams = new ArrayList<ContentStream>( 1 );
|
||||
ContentStreamBase ccc = new ContentStreamBase.StringStream( str );
|
||||
ccc.setContentType( contentType );
|
||||
ArrayList<ContentStream> streams = new ArrayList<ContentStream>();
|
||||
streams.add( ccc );
|
||||
return streams;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue