Use type:store instead of retrievOnly
Change-Id: I9ecbd5f8b1af86d82108999328c77f412c3b627c
diff --git a/src/main/java/de/ids_mannheim/korap/response/MetaField.java b/src/main/java/de/ids_mannheim/korap/response/MetaField.java
index bd065a5..095dd89 100644
--- a/src/main/java/de/ids_mannheim/korap/response/MetaField.java
+++ b/src/main/java/de/ids_mannheim/korap/response/MetaField.java
@@ -23,7 +23,6 @@
public String type = "type:string";
public String key;
public List<String> values = new ArrayList<>();
- public Boolean retrieveOnly = false;
public MetaField (String key) {
this.key = key;
@@ -38,9 +37,6 @@
json.put("type", this.type);
json.put("key", this.key);
- if (this.retrieveOnly)
- json.put("retrieveOnly", true);
-
// Value is numerical
if (this.type.equals("type:number")) {
diff --git a/src/main/java/de/ids_mannheim/korap/response/MetaFields.java b/src/main/java/de/ids_mannheim/korap/response/MetaFields.java
index 5c5a8e5..8e0bd42 100644
--- a/src/main/java/de/ids_mannheim/korap/response/MetaFields.java
+++ b/src/main/java/de/ids_mannheim/korap/response/MetaFields.java
@@ -67,35 +67,25 @@
// Field has numeric value (possibly a date)
if (n != null) {
- // System.err.print("-num");
// TODO:
// check if the number is a date!
mf.type = "type:number";
-
mf.values.add(n.toString());
- // System.err.println(" = " + n.toString());
}
// Field has a textual value
else if (s != null) {
+
+ // Field is not indexed
if (iFieldType.indexOptions() == IndexOptions.NONE) {
- // System.err.print("-readonly");
- mf.retrieveOnly = true;
- // System.err.print("-string");
+ mf.type = "type:store";
}
else if (iFieldType.indexOptions() != IndexOptions.DOCS) {
- // System.err.print("-string");
- /*
- }
- else {
- System.err.print("-text");
- */
mf.type = "type:text";
};
mf.values.add(s.toString());
- // System.err.println(" = " + s);
}
else {
diff --git a/src/test/java/de/ids_mannheim/korap/index/TestKrillIndex.java b/src/test/java/de/ids_mannheim/korap/index/TestKrillIndex.java
index d28c0ab..3dadfcc 100644
--- a/src/test/java/de/ids_mannheim/korap/index/TestKrillIndex.java
+++ b/src/test/java/de/ids_mannheim/korap/index/TestKrillIndex.java
@@ -212,9 +212,8 @@
// TODO: Check if the sorting is always identical!
assertEquals("ref", res.at("/document/fields/0/key").asText());
- assertEquals("type:string", res.at("/document/fields/0/type").asText());
+ assertEquals("type:store", res.at("/document/fields/0/type").asText());
assertEquals("koral:field", res.at("/document/fields/0/@type").asText());
- assertEquals(true, res.at("/document/fields/0/retrieveOnly").asBoolean());
assertEquals("My reference", res.at("/document/fields/0/value").asText());
assertEquals("title", res.at("/document/fields/1/key").asText());