From 2371d6b8dbdf5addf4d7d9124d88f2d976f8dab8 Mon Sep 17 00:00:00 2001 From: orbiter Date: Fri, 1 Aug 2014 13:20:25 +0200 Subject: [PATCH] target linktexts must be string to enable search facets on these fields --- defaults/solr.webgraph.schema | 4 ++-- htroot/api/schema.java | 4 ++-- source/net/yacy/search/schema/WebgraphConfiguration.java | 4 ++-- source/net/yacy/search/schema/WebgraphSchema.java | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/defaults/solr.webgraph.schema b/defaults/solr.webgraph.schema index 65fe663ea..72f0bace5 100644 --- a/defaults/solr.webgraph.schema +++ b/defaults/solr.webgraph.schema @@ -102,7 +102,7 @@ source_host_id_s ## ## the text content of the a-tag (in source, but pointing to a target) -target_linktext_t +target_linktext_s ## the length of the a-tag content text as number of characters (in source, but pointing to a target) #target_linktext_charcount_i @@ -111,7 +111,7 @@ target_linktext_t #target_linktext_wordcount_i ## if the link is an image link, this contains the alt tag if the image is also liked as img link (in source, but pointing to a target) -target_alt_t +target_alt_s ## the length of the a-tag content text as number of characters (in source, but pointing to a target) #target_alt_charcount_i diff --git a/htroot/api/schema.java b/htroot/api/schema.java index 41a5c41f4..ee86d71b5 100644 --- a/htroot/api/schema.java +++ b/htroot/api/schema.java @@ -82,9 +82,9 @@ public class schema { prop.put("solruniquekey", WebgraphSchema.id.getSolrFieldName()); prop.put("solrdefaultsearchfield", - solrSchema.contains(WebgraphSchema.target_linktext_t) ? WebgraphSchema.target_linktext_t.getSolrFieldName() : + solrSchema.contains(WebgraphSchema.target_linktext_s) ? WebgraphSchema.target_linktext_s.getSolrFieldName() : solrSchema.contains(WebgraphSchema.target_name_t) ? WebgraphSchema.target_name_t.getSolrFieldName() : - solrSchema.contains(WebgraphSchema.target_alt_t) ? WebgraphSchema.target_alt_t.getSolrFieldName() : + solrSchema.contains(WebgraphSchema.target_alt_s) ? WebgraphSchema.target_alt_s.getSolrFieldName() : WebgraphSchema.id.getSolrFieldName() ); } diff --git a/source/net/yacy/search/schema/WebgraphConfiguration.java b/source/net/yacy/search/schema/WebgraphConfiguration.java index 1fd575038..9204b95b5 100644 --- a/source/net/yacy/search/schema/WebgraphConfiguration.java +++ b/source/net/yacy/search/schema/WebgraphConfiguration.java @@ -207,12 +207,12 @@ public class WebgraphConfiguration extends SchemaConfiguration implements Serial if (allAttr || contains(WebgraphSchema.target_name_t)) add(edge, WebgraphSchema.target_name_t, name.length() > 0 ? name : ""); if (allAttr || contains(WebgraphSchema.target_rel_s)) add(edge, WebgraphSchema.target_rel_s, rel.length() > 0 ? rel : ""); if (allAttr || contains(WebgraphSchema.target_relflags_i)) add(edge, WebgraphSchema.target_relflags_i, relEval(rel.length() > 0 ? rel : "")); - if (allAttr || contains(WebgraphSchema.target_linktext_t)) add(edge, WebgraphSchema.target_linktext_t, target_url.getTextProperty()); + if (allAttr || contains(WebgraphSchema.target_linktext_s)) add(edge, WebgraphSchema.target_linktext_s, target_url.getTextProperty()); if (allAttr || contains(WebgraphSchema.target_linktext_charcount_i)) add(edge, WebgraphSchema.target_linktext_charcount_i, target_url.getTextProperty().length()); if (allAttr || contains(WebgraphSchema.target_linktext_wordcount_i)) add(edge, WebgraphSchema.target_linktext_wordcount_i, target_url.getTextProperty().length() > 0 ? CommonPattern.SPACE.split(target_url.getTextProperty()).length : 0); if (target_url.getImageAlt() != null) { - if (allAttr || contains(WebgraphSchema.target_alt_t)) add(edge, WebgraphSchema.target_alt_t, target_url.getImageAlt()); + if (allAttr || contains(WebgraphSchema.target_alt_s)) add(edge, WebgraphSchema.target_alt_s, target_url.getImageAlt()); if (allAttr || contains(WebgraphSchema.target_alt_charcount_i)) add(edge, WebgraphSchema.target_alt_charcount_i, target_url.getImageAlt().length()); if (allAttr || contains(WebgraphSchema.target_alt_wordcount_i)) add(edge, WebgraphSchema.target_alt_wordcount_i, target_url.getImageAlt().length() > 0 ? CommonPattern.SPACE.split(target_url.getImageAlt()).length : 0); } diff --git a/source/net/yacy/search/schema/WebgraphSchema.java b/source/net/yacy/search/schema/WebgraphSchema.java index a9d220007..0997611d0 100644 --- a/source/net/yacy/search/schema/WebgraphSchema.java +++ b/source/net/yacy/search/schema/WebgraphSchema.java @@ -62,10 +62,10 @@ public enum WebgraphSchema implements SchemaDeclaration { source_host_subdomain_s(SolrType.string, true, true, false, false, false, "the remaining part of the host without organizationdnc (source)"), // information in the source about the target - target_linktext_t(SolrType.text_general, true, true, false, false, true, "the text content of the a-tag (in source, but pointing to a target)"), + target_linktext_s(SolrType.string, true, true, false, false, true, "the text content of the a-tag (in source, but pointing to a target)"), target_linktext_charcount_i(SolrType.num_integer, true, true, false, false, false, "the length of the a-tag content text as number of characters (in source, but pointing to a target)"), target_linktext_wordcount_i(SolrType.num_integer, true, true, false, false, false, "the length of the a-tag content text as number of words (in source, but pointing to a target)"), - target_alt_t(SolrType.text_general, true, true, false, false, true, "if the link is an image link, this contains the alt tag if the image is also liked as img link (in source, but pointing to a target)"), + target_alt_s(SolrType.string, true, true, false, false, true, "if the link is an image link, this contains the alt tag if the image is also liked as img link (in source, but pointing to a target)"), target_alt_charcount_i(SolrType.num_integer, true, true, false, false, false, "the length of the a-tag content text as number of characters (in source, but pointing to a target)"), target_alt_wordcount_i(SolrType.num_integer, true, true, false, false, false, "the length of the a-tag content text as number of words (in source, but pointing to a target)"), target_name_t(SolrType.text_general, true, true, false, false, true, "the name property of the a-tag (in source, but pointing to a target)"),