diff --git a/defaults/solr.keys.list b/defaults/solr.keys.list index f24602d02..36e2802e6 100644 --- a/defaults/solr.keys.list +++ b/defaults/solr.keys.list @@ -246,6 +246,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 diff --git a/source/net/yacy/search/index/SolrConfiguration.java b/source/net/yacy/search/index/SolrConfiguration.java index 98659fe20..3947b6272 100644 --- a/source/net/yacy/search/index/SolrConfiguration.java +++ b/source/net/yacy/search/index/SolrConfiguration.java @@ -513,6 +513,7 @@ public class SolrConfiguration extends ConfigurationSet implements Serializable final List imgprots = new ArrayList(imagesc.size()); final List imgstubs = new ArrayList(imagesc.size()); final List imgalts = new ArrayList(imagesc.size()); + int withalt = 0; for (final ImageEntry ie: imagesc) { final MultiProtocolURI uri = ie.url(); inboundLinks.remove(uri); @@ -522,12 +523,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)) { diff --git a/source/net/yacy/search/index/YaCySchema.java b/source/net/yacy/search/index/YaCySchema.java index ec8d7818a..8b76cebc6 100644 --- a/source/net/yacy/search/index/YaCySchema.java +++ b/source/net/yacy/search/index/YaCySchema.java @@ -123,6 +123,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"),