Commit 1d1068d2 authored by Matija Obreza's avatar Matija Obreza

Fixed unmapped score field for ES index "fulltext" creation

parent 14ef0707
......@@ -54,8 +54,7 @@ public class FullTextDocument {
private Date lastModifiedDate;
/** The score here will boost result relevance */
@Field(index = FieldIndex.not_analyzed)
private float score = 0.5f;
private Float score = 0.5f;
public Long getId() {
return this.id;
......@@ -121,11 +120,11 @@ public class FullTextDocument {
this.lastModifiedDate = lastModifiedDate;
}
public float getScore() {
public Float getScore() {
return score;
}
public void setScore(float score) {
public void setScore(Float score) {
this.score = score;
}
}
......@@ -400,7 +400,7 @@ public class ElasticsearchSearchServiceImpl implements ElasticService, Initializ
try {
elasticsearchTemplate.putMapping(AccessionDetails.class);
} catch (Throwable e) {
LOG.error("Mapping mismatch. Need to reindex.");
LOG.error("Mapping mismatch. Need to reindex.", e);
}
LOG.info("Refreshing");
elasticsearchTemplate.refresh(AccessionDetails.class, true);
......
......@@ -143,7 +143,7 @@ public class FullTextSearchServiceImpl implements FullTextSearchService, Initial
try {
this.elasticsearchTemplate.putMapping(FullTextDocument.class);
} catch (final Throwable e) {
LOG.error("Mapping mismatch. Need to reindex.");
LOG.error("Mapping mismatch. Need to reindex.", e);
}
LOG.info("Refreshing");
this.elasticsearchTemplate.refresh(FullTextDocument.class, true);
......@@ -514,7 +514,7 @@ public class FullTextSearchServiceImpl implements FullTextSearchService, Initial
}
// If the institute has accessions, we boost it
if (institute.getAccessionCount() > 0) {
document.setScore(institute.getAccessionCount());
document.setScore(0.0f + institute.getAccessionCount());
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment