Skip to content

Commit

Permalink
add study search index, tidy up elastic index references
Browse files Browse the repository at this point in the history
  • Loading branch information
jdhayhurst committed Jan 23, 2025
1 parent 8c8616d commit 2896538
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
6 changes: 3 additions & 3 deletions app/models/Backend.scala
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ class Backend @Inject() (implicit
}

def getVariants(ids: Seq[String]): Future[IndexedSeq[VariantIndex]] = {
val indexName = getIndexOrDefault("variant_index")
val indexName = getIndexOrDefault("variant")
val r = esRetriever
.getByIndexedTermsMust(indexName,
Map("variantId.keyword" -> ids),
Expand All @@ -200,7 +200,7 @@ class Backend @Inject() (implicit
}

def getStudy(ids: Seq[String]): Future[IndexedSeq[JsValue]] = {
val indexName = getIndexOrDefault("gwas_index")
val indexName = getIndexOrDefault("study")
val termsQuery = Map("studyId.keyword" -> ids)
val retriever =
esRetriever
Expand All @@ -215,7 +215,7 @@ class Backend @Inject() (implicit

def getStudies(queryArgs: StudyQueryArgs, pagination: Option[Pagination]): Future[Studies] = {
val pag = pagination.getOrElse(Pagination.mkDefault)
val indexName = getIndexOrDefault("gwas_index")
val indexName = getIndexOrDefault("study")
val diseaseIds: Seq[String] =
if (queryArgs.enableIndirect) {
val diseases = getDiseases(queryArgs.diseaseIds)
Expand Down
11 changes: 10 additions & 1 deletion conf/application.conf
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,10 @@ ot {
name = "cancerBiomarker"
index = "cancerbiomarker"
},
{
name = "credible_set"
index = "credible_set"
},
{
name = "target"
index = "target"
Expand All @@ -145,7 +149,7 @@ ot {
},
{
name = "variant"
index = "variant"
index = "variant_index"
searchIndex = "search_variant"
},
{
Expand All @@ -172,6 +176,11 @@ ot {
{
name = "drugWarnings"
index = "drug_warnings"
},
{
name = "study"
index = "gwas_index"
searchIndex = "search_study"
}
]
highlightFields = [
Expand Down

0 comments on commit 2896538

Please sign in to comment.