diff --git a/src/main/java/com/loafle/overflow/crawler/result/OFResultSet.java b/src/main/java/com/loafle/overflow/crawler/result/OFResultSet.java index ac50fc0..3ebc56e 100644 --- a/src/main/java/com/loafle/overflow/crawler/result/OFResultSet.java +++ b/src/main/java/com/loafle/overflow/crawler/result/OFResultSet.java @@ -41,7 +41,29 @@ public class OFResultSet { } - public void setMeta(List meta) { + public void setMeta() { + + + String type = (String) this.item.getQuery().getQueryInfo().get("parseDirection"); + List meta = new ArrayList<>(); + if (type.equals("row")) { + + List arrayColumns = (List) this.item.getQuery().getQueryInfo().get("arrayColumns"); + List keyColumns = (List) this.item.getQuery().getQueryInfo().get("keyColumns"); + String valueColumn = (String) this.item.getQuery().getQueryInfo().get("valueColumn"); + + for (String c : arrayColumns) { + meta.add(c); + } + for (String c: keyColumns) { + meta.add(c); + } + meta.add(valueColumn); + + } else { + + } + if(this.meta == null) { this.meta = new HashMap<>(); @@ -54,13 +76,9 @@ public class OFResultSet { } public OFResultSet(Item item) { - this(item,null); - } - - public OFResultSet(Item item,List meta) { this.item = item; this.rows = new ArrayList<>(); - this.setMeta(meta); + this.setMeta(); } public void addRow(List row) {