This commit is contained in:
Michael Peter Christen 2012-07-23 00:36:18 +02:00
parent b76836db7b
commit cba4ab862e
2 changed files with 5 additions and 2 deletions

View File

@ -114,6 +114,8 @@ public class ViewFile {
String urlHash = post.get("urlHash", "");
URIMetadata urlEntry = null;
// get the urlEntry that belongs to the url hash
//boolean ue = urlHash.length() > 0 && indexSegment.exists(ASCII.getBytes(urlHash));
//if (ue) Log.logInfo("ViewFile", "exists(" + urlHash + ")");
if (urlHash.length() > 0 && (urlEntry = indexSegment.urlMetadata().load(ASCII.getBytes(urlHash))) != null) {
// get the url that belongs to the entry
if (urlEntry == null || urlEntry.url() == null) {

View File

@ -221,8 +221,8 @@ public class AbstractSolrConnector implements SolrConnector {
@Override
public SolrDocument get(final String id) throws IOException {
// construct query
StringBuffer sb = new StringBuffer(id.length() + 3);
sb.append(SolrField.id.getSolrFieldName()).append(':').append(id);
StringBuffer sb = new StringBuffer(id.length() + 5);
sb.append(SolrField.id.getSolrFieldName()).append(':').append('"').append(id).append('"');
final SolrQuery query = new SolrQuery();
query.setQuery(sb.toString());
query.setRows(1);
@ -235,6 +235,7 @@ public class AbstractSolrConnector implements SolrConnector {
if (docs.isEmpty()) return null;
return docs.get(0);
} catch (final Throwable e) {
Log.logWarning("AbstractSolrConnection", "problem with id=" + id, e);
throw new IOException(e);
}
}