Mark notinindex-fields
Change-Id: I86e85b38c1512edbe2d821b8718fb4bc52d4ae16
diff --git a/dev/demo/matchdemo.js b/dev/demo/matchdemo.js
index 437c47c..37a6681 100644
--- a/dev/demo/matchdemo.js
+++ b/dev/demo/matchdemo.js
@@ -460,7 +460,7 @@
" <span title=\"mate/l:deutlich\">" +
" <span title=\"mate/m:degree:pos\">" +
" <span title=\"mate/p:ADJD\">" +
- " <span title=\"opennlp/p:ADJD\">deutlich</span>" +
+ " <span title=\"opennlp/p:ADJD\" class=\"notinindex\">deutlich</span>" +
" </span>" +
" </span>" +
" </span>" +
@@ -669,6 +669,13 @@
},
{
"@type":"koral:field",
+ "key":"wiki",
+ "type":"type:string",
+ "value":"Science",
+ "comment":"notinindex"
+ },
+ {
+ "@type":"koral:field",
"key":"foundries",
"type":"type:keywords",
"value":[
diff --git a/dev/js/spec/matchSpec.js b/dev/js/spec/matchSpec.js
index 20fecbd..43b9ac6 100644
--- a/dev/js/spec/matchSpec.js
+++ b/dev/js/spec/matchSpec.js
@@ -106,6 +106,13 @@
"type": "type:attachement",
"value": "data:,This is a reference"
},
+ {
+ "@type": "koral:field",
+ "key": "zz-notinindex",
+ "type": "type:text",
+ "comment": "notinindex",
+ "value": "Stored but not indexed"
+ },
];
@@ -1095,6 +1102,16 @@
expect(mel.children[6].children[0].firstChild.nodeValue).toEqual('z-reference');
expect(mel.children[6].children[1].firstChild.nodeValue).toEqual('This is a reference');
});
+
+ it('should mark metadata not in index', function () {
+ let notInIndexField = Array.from(mel.children).find(function (field) {
+ return field.children[0].firstChild.nodeValue === 'zz-notinindex';
+ });
+
+ expect(notInIndexField).toBeTruthy();
+ expect(notInIndexField.children[1].classList.contains('notinindex')).toBeTruthy();
+ expect(notInIndexField.children[1].firstChild.nodeValue).toEqual('Stored but not indexed');
+ });
diff --git a/dev/js/src/match/corpusByMatch.js b/dev/js/src/match/corpusByMatch.js
index 4b8ec73..d594811 100644
--- a/dev/js/src/match/corpusByMatch.js
+++ b/dev/js/src/match/corpusByMatch.js
@@ -110,7 +110,7 @@
};
// Ignore stored types
- if (type === "type:store" || type === "type:attachement")
+ if (type === "type:store" || type === "type:attachement" || target.classList.contains("notinindex"))
return;
type = type || "type:string";
diff --git a/dev/js/src/match/meta.js b/dev/js/src/match/meta.js
index 02dfa53..2cec7af 100644
--- a/dev/js/src/match/meta.js
+++ b/dev/js/src/match/meta.js
@@ -63,6 +63,7 @@
let field = fields[posInMetaArray[k]]; // This is the object
let metaL, dt, metaDescr, metaDD, att;
+ const isNotInIndex = field["comment"] === "notinindex";
// Ignore internal IDs
if (k !== "UID" &&
@@ -72,7 +73,7 @@
k !== "layerInfos") {
metaL = document.createElement('div');
-
+
dt = metaL.addE('dt');
dt.addT(k);
dt.setAttribute("title", k);
@@ -80,6 +81,9 @@
metaDescr = field["value"];
metaDD = metaL.addE('dd');
metaDD.setAttribute('data-type', field["type"]);
+ if (isNotInIndex) {
+ metaDD.classList.add("notinindex");
+ };
if(metaDescr instanceof Array){
metaDD.classList.add("metakeyvalues");
diff --git a/dev/scss/main/view/metatable.scss b/dev/scss/main/view/metatable.scss
index 55f0ea0..e1cecc9 100644
--- a/dev/scss/main/view/metatable.scss
+++ b/dev/scss/main/view/metatable.scss
@@ -25,6 +25,12 @@
background-color: colors.$light-orange;
cursor: pointer;
+
+ &.notinindex {
+ background-color: colors.$ids-grey-2 !important;
+ cursor: default;
+ }
+
&.metakeyvalues {
> div {
@@ -52,7 +58,8 @@
}
&[data-type="type:store"],
- &[data-type="type:attachement"] {
+ &[data-type="type:attachement"],
+ &.notinindex {
background-color: colors.$middle-orange;
cursor: default;