Permalink
Browse files

info makes little sence in post calls..

  • Loading branch information...
hofmeister committed May 22, 2011
1 parent c3a6487 commit 32bb09ceb5edb57a4d2f96e6c3e4cf1fd846ddc8
Showing with 21 additions and 23 deletions.
  1. +21 −23 src/main/java/com/github/rnewson/couchdb/lucene/LuceneServlet.java
@@ -229,30 +229,28 @@ private void doPostInternal(final HttpServletRequest req, final HttpServletRespo
ServletUtils.sendJsonError(req, resp, 500, "error_creating_index");
return;
}
if (req.getContentLength() == 0) {
indexer.info(req, resp);
} else {
BufferedReader reader = req.getReader();
StringWriter writer = new StringWriter();
char[] buffer = new char[1024];
try {
int n;
while ((n = reader.read(buffer)) != -1) {
writer.write(buffer, 0, n);
}
} catch(Exception ex) {
log("Could not read input", ex);
ServletUtils.sendJsonError(req, resp, 500, "could not read input");
reader.close();
return;
} finally {
reader.close();
}
String query = writer.toString();
indexer.search(query,req, resp);
BufferedReader reader = req.getReader();
StringWriter writer = new StringWriter();
char[] buffer = new char[1024];
try {
int n;
while ((n = reader.read(buffer)) != -1) {
writer.write(buffer, 0, n);
}
} catch(Exception ex) {
log("Could not read input", ex);
ServletUtils.sendJsonError(req, resp, 500, "could not read input");
reader.close();
return;
} finally {
reader.close();
}
String query = writer.toString();
indexer.search(query,req, resp);
return;
case 6:
indexer = getIndexer(req);

0 comments on commit 32bb09c

Please sign in to comment.