Index authors' institutions
This commit is contained in:
parent
9dbfe1ccc4
commit
b1d6afb7fe
|
@ -81,15 +81,18 @@ public class Indexer {
|
|||
doc.add(new StringField("document_id", paper.paper_id, Field.Store.YES));
|
||||
doc.add(new TextField("title", paper.metadata.title, Field.Store.YES));
|
||||
StringBuilder authors = new StringBuilder();
|
||||
StringBuilder institutions = new StringBuilder();
|
||||
for (Author author : paper.metadata.authors) {
|
||||
String authorName = author.first + " " + author.middle + " " + author.last;
|
||||
authorName = authorName.replaceAll("\\p{P}", "");
|
||||
authors.append(authorName);
|
||||
institutions.append(author.affiliation.institution);
|
||||
}
|
||||
doc.add(new TextField("authors", authors.toString(), Field.Store.YES));
|
||||
doc.add(new TextField("institution", institutions.toString(), Field.Store.NO));
|
||||
StringBuilder fullAbstract = new StringBuilder();
|
||||
for (Abstract abstract_ : paper.abstract_) {
|
||||
fullAbstract.append(abstract_.text);
|
||||
for (Abstract abstr : paper.abstr) {
|
||||
fullAbstract.append(abstr.text);
|
||||
}
|
||||
doc.add(new TextField("abstract", fullAbstract.toString(), Field.Store.NO));
|
||||
index.addDocument(doc);
|
||||
|
|
|
@ -43,6 +43,6 @@ public class Paper {
|
|||
String paper_id;
|
||||
Metadata metadata;
|
||||
@SerializedName("abstract")
|
||||
List<Abstract> abstract_;
|
||||
List<Abstract> abstr;
|
||||
List<Body_Text> body_text;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue