added solr field images_withalt_i

pull/1/head
orbiter 13 years ago
parent 66ac4076c2
commit d73fff0e0e

@ -228,6 +228,9 @@ h6_txt
## all image link alt tag
#images_alt_txt
## number of image links with alt tag
#images_withalt_i
## binary pattern for the existance of h1..h6 headlines, int
#htags_i

@ -510,6 +510,7 @@ public class SolrConfiguration extends ConfigurationSet implements Serializable
final List<String> imgprots = new ArrayList<String>(imagesc.size());
final List<String> imgstubs = new ArrayList<String>(imagesc.size());
final List<String> imgalts = new ArrayList<String>(imagesc.size());
int withalt = 0;
for (final ImageEntry ie: imagesc) {
final MultiProtocolURI uri = ie.url();
inboundLinks.remove(uri);
@ -519,12 +520,14 @@ public class SolrConfiguration extends ConfigurationSet implements Serializable
imgprots.add(protocol);
imgstubs.add(uri.toString().substring(protocol.length() + 3));
imgalts.add(ie.alt());
if (ie.alt() != null && ie.alt().length() > 0) withalt++;
}
if (allAttr || contains(YaCySchema.imagescount_i)) add(doc, YaCySchema.imagescount_i, imgtags.size());
if (allAttr || contains(YaCySchema.images_tag_txt)) add(doc, YaCySchema.images_tag_txt, imgtags);
if (allAttr || contains(YaCySchema.images_protocol_sxt)) add(doc, YaCySchema.images_protocol_sxt, protocolList2indexedList(imgprots));
if (allAttr || contains(YaCySchema.images_urlstub_txt)) add(doc, YaCySchema.images_urlstub_txt, imgstubs);
if (allAttr || contains(YaCySchema.images_alt_txt)) add(doc, YaCySchema.images_alt_txt, imgalts);
if (allAttr || contains(YaCySchema.images_withalt_i)) add(doc, YaCySchema.images_alt_txt, withalt);
// style sheets
if (allAttr || contains(YaCySchema.css_tag_txt)) {

@ -117,6 +117,7 @@ public enum YaCySchema implements Schema {
images_urlstub_txt(SolrType.text_general, true, true, true, "all image links without the protocol and '://'"),
images_protocol_sxt(SolrType.text_general, true, true, true, "all image link protocols"),
images_alt_txt(SolrType.text_general, true, true, true, "all image link alt tag"),
images_withalt_i(SolrType.integer, true, true, false, "number of image links with alt tag"),
htags_i(SolrType.integer, true, true, false, "binary pattern for the existance of h1..h6 headlines"),
canonical_t(SolrType.text_general, true, true, false, "url inside the canonical link element"),
refresh_s(SolrType.string, true, true, false, "link from the url property inside the refresh link element"),

Loading…
Cancel
Save