fix for the usage of ready-prepared solr queries, some queries are

formulated as edismax query but this was not set as query attribut. The
defType=edismax property needs a qf-field, so this was added as well. Do
not remove that field again! This fixes also a problem with title-unique
computation.
pull/1/head
orbiter 10 years ago
parent f94c91315b
commit 1027f3d04a

@ -288,7 +288,8 @@ public abstract class AbstractSolrConnector implements SolrConnector {
params.setFacet(false); params.setFacet(false);
if (fields.length > 0) params.setFields(fields); if (fields.length > 0) params.setFields(fields);
params.setIncludeScore(false); params.setIncludeScore(false);
params.setParam("defType", "edismax");
params.setParam("qf", CollectionSchema.text_t.getSolrFieldName() + "^1.0");
return params; return params;
} }

@ -400,6 +400,7 @@ public final class QueryParams {
private SolrQuery getBasicParams(boolean getFacets) { private SolrQuery getBasicParams(boolean getFacets) {
final SolrQuery params = new SolrQuery(); final SolrQuery params = new SolrQuery();
params.setParam("defType", "edismax"); params.setParam("defType", "edismax");
params.setParam("qf", CollectionSchema.text_t.getSolrFieldName() + "^1.0");
params.setStart(this.offset); params.setStart(this.offset);
params.setRows(this.itemsPerPage); params.setRows(this.itemsPerPage);
params.setFacet(false); params.setFacet(false);

@ -1422,17 +1422,18 @@ public class CollectionConfiguration extends SchemaConfiguration implements Seri
continue uniquecheck; continue uniquecheck;
} }
try { try {
long doccount = segment.fulltext().getDefaultConnector().getCountByQuery( String doccountquery =
CollectionSchema.host_id_s.getSolrFieldName() + ":\"" + hostid + "\" AND " + CollectionSchema.host_id_s.getSolrFieldName() + ":\"" + hostid + "\" AND " +
"-" + CollectionSchema.robots_i.getSolrFieldName() + ":8 AND " + // bit 3 "-" + CollectionSchema.robots_i.getSolrFieldName() + ":8 AND " + // bit 3
"-" + CollectionSchema.robots_i.getSolrFieldName() + ":24 AND " + // bit 3 + 4 "-" + CollectionSchema.robots_i.getSolrFieldName() + ":24 AND " + // bit 3 + 4
"-" + CollectionSchema.robots_i.getSolrFieldName() + ":512 AND " + // bit 9 "-" + CollectionSchema.robots_i.getSolrFieldName() + ":512 AND " + // bit 9
"-" + CollectionSchema.robots_i.getSolrFieldName() + ":1536 AND " + // bit 9 + 10 "-" + CollectionSchema.robots_i.getSolrFieldName() + ":1536 AND " + // bit 9 + 10
"(-" + CollectionSchema.canonical_equal_sku_b.getSolrFieldName() + ":[* TO *] OR " + CollectionSchema.canonical_equal_sku_b.getSolrFieldName() + ":true ) AND " + "((-" + CollectionSchema.canonical_equal_sku_b.getSolrFieldName() + ":[* TO *]) OR (" + CollectionSchema.canonical_equal_sku_b.getSolrFieldName() + ":true)) AND " +
CollectionSchema.httpstatus_i.getSolrFieldName() + ":200 AND " + CollectionSchema.httpstatus_i.getSolrFieldName() + ":200 AND " +
"-" + CollectionSchema.id.getSolrFieldName() + ":\"" + urlhash + "\" AND " + "-" + CollectionSchema.id.getSolrFieldName() + ":\"" + urlhash + "\" AND " +
signaturefield.getSolrFieldName() + ":\"" + signature.toString() + "\""); signaturefield.getSolrFieldName() + ":\"" + signature.toString() + "\"";
sid.setField(uniquefield.getSolrFieldName(), doccount == 0); long doccount = segment.fulltext().getDefaultConnector().getCountByQuery(doccountquery);
sid.setField(uniquefield.getSolrFieldName(), doccount == 0);
} catch (final IOException e) {} } catch (final IOException e) {}
} }
} }

Loading…
Cancel
Save