Index the abstract
This commit is contained in:
parent
6a3087cabd
commit
a4d505ce06
|
@ -2,3 +2,4 @@ data
|
||||||
data-test
|
data-test
|
||||||
target
|
target
|
||||||
output
|
output
|
||||||
|
.index
|
||||||
|
|
|
@ -85,6 +85,11 @@ public class Indexer {
|
||||||
authorName = authorName.replaceAll("\\p{P}", "");
|
authorName = authorName.replaceAll("\\p{P}", "");
|
||||||
doc.add(new TextField("authors", authorName, Field.Store.YES));
|
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);
|
index.addDocument(doc);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2,6 +2,8 @@ package org.RI.P2;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.google.gson.annotations.SerializedName;
|
||||||
|
|
||||||
class Affiliation {
|
class Affiliation {
|
||||||
String laboratory;
|
String laboratory;
|
||||||
String institution;
|
String institution;
|
||||||
|
@ -40,6 +42,7 @@ class Body_Text {
|
||||||
public class Paper {
|
public class Paper {
|
||||||
String paper_id;
|
String paper_id;
|
||||||
Metadata metadata;
|
Metadata metadata;
|
||||||
List<Abstract> _abstract;
|
@SerializedName("abstract")
|
||||||
|
List<Abstract> abstract_;
|
||||||
List<Body_Text> body_text;
|
List<Body_Text> body_text;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue