Skip to content

Commit

Permalink
#90: Change findNameStringByUuid match type to UUIDLookup
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-myltsev committed Nov 9, 2016
1 parent 91134f1 commit 6f49c25
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 12 deletions.
10 changes: 5 additions & 5 deletions api/src/test/resources/test_data/name_strings/paging/page1.conf
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ response {
"vernaculars": [

],
"matchType": "None",
"matchType": "UUIDLookup",
"dataSourceTitle": "Catalogue of Life",
"canonicalNameUuid": "ee4558c2-dcf9-5831-a53f-4c3ac03d364f"
},
Expand All @@ -50,7 +50,7 @@ response {
"vernaculars": [

],
"matchType": "None",
"matchType": "UUIDLookup",
"dataSourceTitle": "ITIS",
"canonicalNameUuid": "ee4558c2-dcf9-5831-a53f-4c3ac03d364f"
},
Expand All @@ -68,7 +68,7 @@ response {
"vernaculars": [

],
"matchType": "None",
"matchType": "UUIDLookup",
"dataSourceTitle": "Interim Register of Marine and Nonmarine Genera",
"canonicalNameUuid": "ee4558c2-dcf9-5831-a53f-4c3ac03d364f"
},
Expand All @@ -86,7 +86,7 @@ response {
"vernaculars": [

],
"matchType": "None",
"matchType": "UUIDLookup",
"dataSourceTitle": "WoRMS",
"canonicalNameUuid": "ee4558c2-dcf9-5831-a53f-4c3ac03d364f"
},
Expand All @@ -104,7 +104,7 @@ response {
"vernaculars": [

],
"matchType": "None",
"matchType": "UUIDLookup",
"dataSourceTitle": "GBIF Backbone Taxonomy",
"canonicalNameUuid": "ee4558c2-dcf9-5831-a53f-4c3ac03d364f"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ response {
"surrogate": false,
"taxonId": "33255784",
"canonicalName": "Pododesmus rudis",
"matchType": "None",
"matchType": "UUIDLookup",
"dataSourceTitle": "EOL",
"canonicalNameUuid": "ee4558c2-dcf9-5831-a53f-4c3ac03d364f"
},
Expand All @@ -51,7 +51,7 @@ response {
"surrogate": false,
"taxonId": "36507198",
"canonicalName": "Pododesmus rudis",
"matchType": "None",
"matchType": "UUIDLookup",
"dataSourceTitle": "EOL",
"canonicalNameUuid": "ee4558c2-dcf9-5831-a53f-4c3ac03d364f"
},
Expand All @@ -69,7 +69,7 @@ response {
"surrogate": false,
"taxonId": "131877663",
"canonicalName": "Pododesmus rudis",
"matchType": "None",
"matchType": "UUIDLookup",
"dataSourceTitle": "nlbif",
"canonicalNameUuid": "ee4558c2-dcf9-5831-a53f-4c3ac03d364f"
},
Expand All @@ -87,7 +87,7 @@ response {
"surrogate": false,
"taxonId": "94118348",
"canonicalName": "Pododesmus rudis",
"matchType": "None",
"matchType": "UUIDLookup",
"dataSourceTitle": "uBio NameBank",
"canonicalNameUuid": "ee4558c2-dcf9-5831-a53f-4c3ac03d364f"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ response {
"surrogate": false,
"taxonId": "12965815",
"canonicalName": "Pododesmus rudis",
"matchType": "None",
"matchType": "UUIDLookup",
"dataSourceTitle": "Catalogue of Life",
"canonicalNameUuid": "ee4558c2-dcf9-5831-a53f-4c3ac03d364f"
},
Expand Down Expand Up @@ -62,7 +62,7 @@ response {
"surrogate": false,
"taxonId": "79794",
"canonicalName": "Pododesmus rudis",
"matchType": "None",
"matchType": "UUIDLookup",
"dataSourceTitle": "ITIS",
"canonicalNameUuid": "ee4558c2-dcf9-5831-a53f-4c3ac03d364f"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,6 @@ class FacetedSearcher(val db: Database) extends Materializer {

def findNameStringByUuid(uuid: UUID, parameters: Parameters): Future[Matches] = {
nameStringsMatches(nameStrings.filter { ns => ns.id === uuid },
parameters.copy(query = uuid.toString))
parameters.copy(query = uuid.toString, matchType = MatchType.UUIDLookup))
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ package object model {
case object ExactNameMatchByUUID extends MatchType
case object ExactCanonicalNameMatchByUUID extends MatchType
case object Fuzzy extends MatchType
case object UUIDLookup extends MatchType
}

type LocalId = Int
Expand Down

0 comments on commit 6f49c25

Please sign in to comment.