Skip to content

Commit

Permalink
Merge pull request bst-mug#100 from michelole/issue-76
Browse files Browse the repository at this point in the history
Boosts `extra` topics (ASCO and AACR)
  • Loading branch information
michelole authored Jul 13, 2017
2 parents cfe174a + b4d9335 commit f6a338a
Show file tree
Hide file tree
Showing 2 changed files with 90 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/java/at/medunigraz/imi/bst/trec/RunnerDemo.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public class RunnerDemo {
public static void main(String[] args) {
String[] pmRuns = { "example-pmid", "extra-pmid", "topics2017-pmid" };

final File pmTemplate = new File(RunnerDemo.class.getResource("/templates/must-match-gene.json").getFile());
final File pmTemplate = new File(RunnerDemo.class.getResource("/templates/boost-extra.json").getFile());
Gene.Field[] expandTo = { Gene.Field.SYMBOL, Gene.Field.DESCRIPTION };
Query pmDecorator = new WordRemovalQueryDecorator(
new TemplateQueryDecorator(pmTemplate, new ElasticSearchQuery("trec")));
Expand Down
89 changes: 89 additions & 0 deletions src/main/resources/templates/boost-extra.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
{
"bool": {
"must": [
{
"multi_match": {
"query": "{{disease}}",
"fields": [
"title^2",
"abstract",
"keyword",
"meshTags"
],
"tie_breaker": 0.3,
"type": "best_fields",
"boost": 1
}
},
{
"multi_match": {
"query": "{{gene}}",
"fields": [
"title^2",
"abstract",
"keyword",
"meshTags"
],
"tie_breaker": 0.3,
"type": "best_fields"
}
}
],
"should": [
{
"match": {
"_type": "extra"
}
},
{
"bool": {
"should": {
"multi_match": {
"query": "cancer carcinoma tumor",
"fields": [
"title^2",
"abstract",
"keyword",
"meshTags"
],
"tie_breaker": 0.3,
"type": "best_fields"
}
}
}
},
{
"bool": {
"should": {
"multi_match": {
"query": "gene genotype DNA base",
"fields": [
"title^2",
"abstract",
"keyword",
"meshTags"
],
"tie_breaker": 0.3,
"type": "best_fields"
}
}
}
},
{
"bool": {
"should": {
"multi_match": {
"query": "prognosis prognostic therapy treatment case report patient results",
"fields": [
"title^2",
"abstract"
],
"tie_breaker": 0.3,
"type": "best_fields"
}
}
}
}
]
}
}

0 comments on commit f6a338a

Please sign in to comment.