diff --git a/.gitignore b/.gitignore index 45647a1..0702298 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ data data-test target output +.index diff --git a/src/main/java/org/RI/P2/Indexer.java b/src/main/java/org/RI/P2/Indexer.java index c0de104..3d2af20 100644 --- a/src/main/java/org/RI/P2/Indexer.java +++ b/src/main/java/org/RI/P2/Indexer.java @@ -85,6 +85,11 @@ public class Indexer { authorName = authorName.replaceAll("\\p{P}", ""); doc.add(new TextField("authors", authorName, Field.Store.YES)); } + StringBuilder fullAbstract = new StringBuilder(); + for (Abstract abstract_ : paper.abstract_) { + fullAbstract.append(abstract_.text); + } + doc.add(new TextField("abstract", fullAbstract.toString(), Field.Store.NO)); index.addDocument(doc); } diff --git a/src/main/java/org/RI/P2/Paper.java b/src/main/java/org/RI/P2/Paper.java index e443c1f..a6c01ae 100644 --- a/src/main/java/org/RI/P2/Paper.java +++ b/src/main/java/org/RI/P2/Paper.java @@ -2,6 +2,8 @@ package org.RI.P2; import java.util.List; +import com.google.gson.annotations.SerializedName; + class Affiliation { String laboratory; String institution; @@ -40,6 +42,7 @@ class Body_Text { public class Paper { String paper_id; Metadata metadata; - List _abstract; + @SerializedName("abstract") + List abstract_; List body_text; }