Last active
November 22, 2019 22:50
-
-
Save duanebester/8ccaba025313b5d6d05d4172600e0ceb to your computer and use it in GitHub Desktop.
ElasticHelper trait
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
trait ElasticHelpers { | |
final val USER_INDEX = "test-users" | |
final val COFFEE_SHOPS_INDEX = "test-coffee-shops" | |
val elasticProps: ElasticProperties | |
val elasticClient: ElasticClient | |
def searchUsers(filter: Filter): Future[SearchResponse[User]] | |
def searchCoffeeShops(filter: Filter): Future[CoffeeShopsResponse] | |
def geoQuery(geom: BBox): GeoBoundingBoxQuery = | |
geoBoxQuery("location").corners( | |
Corners( | |
geom.topLeft.lat.toDouble, | |
geom.topLeft.lon.toDouble, | |
geom.bottomRight.lat.toDouble, | |
geom.bottomRight.lon.toDouble | |
) | |
) | |
def buildQuery(filter: Filter): BoolQuery | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment