fixed the size() method which counted also failed pages (which are also

inside the solr index)
pull/1/head
orbiter 12 years ago
parent 6ec02deec6
commit 4987921d3d

@ -46,6 +46,13 @@ public abstract class AbstractSolrConnector implements SolrConnector {
catchallQuery.setRows(1);
catchallQuery.setStart(0);
}
public final static SolrQuery catchSuccessQuery = new SolrQuery();
static {
catchallQuery.setQuery("-" + YaCySchema.failreason_t.name() + ":[* TO *]");
catchallQuery.setFields(YaCySchema.id.name());
catchallQuery.setRows(1);
catchallQuery.setStart(0);
}
private final static int pagesize = 10;
@Override

@ -92,7 +92,7 @@ public abstract class SolrServerConnector extends AbstractSolrConnector implemen
@Override
public long getSize() {
try {
final QueryResponse rsp = query(AbstractSolrConnector.catchallQuery);
final QueryResponse rsp = query(AbstractSolrConnector.catchSuccessQuery);
if (rsp == null) return 0;
final SolrDocumentList docs = rsp.getResults();
if (docs == null) return 0;

Loading…
Cancel
Save