refactor: just some more useages of constant for term ":[* TO *]"

pull/1/head
reger 10 years ago
parent 8c491f51a5
commit 9e1ec5fec4

@ -266,7 +266,7 @@ public class HostBrowser {
ff.add(csf.getSolrFieldName());
}
// add also vocabulary counters
Map<String, ReversibleScoreMap<String>> vocabularyFacet = sb.index.fulltext().getDefaultConnector().getFacets(CollectionSchema.vocabularies_sxt.getSolrFieldName() + ":[* TO *]", 100, CollectionSchema.vocabularies_sxt.getSolrFieldName());
Map<String, ReversibleScoreMap<String>> vocabularyFacet = sb.index.fulltext().getDefaultConnector().getFacets(CollectionSchema.vocabularies_sxt.getSolrFieldName() + AbstractSolrConnector.CATCHALL_DTERM, 100, CollectionSchema.vocabularies_sxt.getSolrFieldName());
if (vocabularyFacet.size() > 0) {
Collection<String> vocnames = vocabularyFacet.values().iterator().next().keyList(true);
for (String vocname: vocnames) {

@ -29,6 +29,7 @@ import java.util.Map.Entry;
import net.yacy.cora.federate.solr.Ranking;
import net.yacy.cora.federate.solr.SchemaDeclaration;
import net.yacy.cora.federate.solr.connector.AbstractSolrConnector;
import net.yacy.cora.protocol.RequestHeader;
import net.yacy.cora.sorting.ReversibleScoreMap;
import net.yacy.cora.util.ConcurrentLog;
@ -172,7 +173,7 @@ public class RankingSolr_p {
// make boost hints for vocabularies
Map<String, ReversibleScoreMap<String>> vocabularyFacet;
try {
vocabularyFacet = sb.index.fulltext().getDefaultConnector().getFacets(CollectionSchema.vocabularies_sxt.getSolrFieldName() + ":[* TO *]", 100, CollectionSchema.vocabularies_sxt.getSolrFieldName());
vocabularyFacet = sb.index.fulltext().getDefaultConnector().getFacets(CollectionSchema.vocabularies_sxt.getSolrFieldName() + AbstractSolrConnector.CATCHALL_DTERM, 100, CollectionSchema.vocabularies_sxt.getSolrFieldName());
} catch (IOException e) {
ConcurrentLog.logException(e);
vocabularyFacet = new HashMap<>();

@ -59,7 +59,7 @@ public class CatchallLiteral extends Literal implements Term {
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(this.key.getSolrFieldName());
sb.append(':').append(AbstractSolrConnector.CATCHALL_TERM);
sb.append(AbstractSolrConnector.CATCHALL_DTERM);
return sb.toString();
}

@ -1315,13 +1315,13 @@ public class CollectionConfiguration extends SchemaConfiguration implements Seri
if (count > 0) {
Map<String, ReversibleScoreMap<String>> partitioningFacet = collectionConnector.getFacets("{!cache=false}" + collection1query, 100000, partitioningKey);
ReversibleScoreMap<String> partitioning = partitioningFacet.get(partitioningKey);
long emptyCount = collectionConnector.getCountByQuery("{!cache=false}" + "-" + partitioningKey + ":[* TO *] AND (" + collection1query + ")");
long emptyCount = collectionConnector.getCountByQuery("{!cache=false}" + "-" + partitioningKey + AbstractSolrConnector.CATCHALL_DTERM + " AND (" + collection1query + ")");
if (emptyCount > 0) partitioning.inc("", (int) emptyCount);
final long start = System.currentTimeMillis();
List<String> querystrings = new ArrayList<>(partitioning.size());
for (String partitioningValue: partitioning) {
String partitioningQuery = "{!cache=false}" + ((partitioningValue.length() == 0) ?
"-" + partitioningKey + ":[* TO *] AND (" + collection1query + ")" :
"-" + partitioningKey + AbstractSolrConnector.CATCHALL_DTERM + " AND (" + collection1query + ")" :
partitioningKey + ":" + partitioningValue + " AND (" + collection1query + ")");
querystrings.add(partitioningQuery);
}

Loading…
Cancel
Save