better searchhost configuration
This commit is contained in:
parent
a410e8607b
commit
e44d5e4ee1
3 changed files with 8 additions and 12 deletions
|
@ -151,7 +151,6 @@ deleteIndexES input = do
|
||||||
runBH' action = do
|
runBH' action = do
|
||||||
master <- getYesod
|
master <- getYesod
|
||||||
let s = appSearchHost $ appSettings master
|
let s = appSearchHost $ appSettings master
|
||||||
let p = show $ appSearchPort $ appSettings master
|
let server = Server s
|
||||||
let server = Server $ T.pack $ (T.unpack s) ++ ":" ++ show p
|
|
||||||
manager <- liftIO $ newManager defaultManagerSettings
|
manager <- liftIO $ newManager defaultManagerSettings
|
||||||
runBH (BHEnv server manager) action
|
runBH (BHEnv server manager) action
|
||||||
|
|
14
Settings.hs
14
Settings.hs
|
@ -75,10 +75,9 @@ data AppSettings = AppSettings
|
||||||
, appTos1 :: Text
|
, appTos1 :: Text
|
||||||
, appTos2 :: Text
|
, appTos2 :: Text
|
||||||
-- ^ Terms of Service
|
-- ^ Terms of Service
|
||||||
, appSearchHost :: Text
|
, appSearchHost :: Text
|
||||||
, appSearchPort :: Int
|
, appShards :: Int
|
||||||
, appShards :: Int
|
, appReplicas :: Int
|
||||||
, appReplicas :: Int
|
|
||||||
-- ^ Settings for Elasticsearch
|
-- ^ Settings for Elasticsearch
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -111,10 +110,9 @@ instance FromJSON AppSettings where
|
||||||
appTos1 <- o .: "tos1"
|
appTos1 <- o .: "tos1"
|
||||||
appTos2 <- o .: "tos2"
|
appTos2 <- o .: "tos2"
|
||||||
|
|
||||||
appSearchHost <- o .: "searchhost"
|
appSearchHost <- o .: "searchhost"
|
||||||
appSearchPort <- o .: "searchport"
|
appShards <- o .: "shards"
|
||||||
appShards <- o .: "shards"
|
appReplicas <- o .: "replicas"
|
||||||
appReplicas <- o .: "replicas"
|
|
||||||
|
|
||||||
return AppSettings {..}
|
return AppSettings {..}
|
||||||
|
|
||||||
|
|
|
@ -53,7 +53,6 @@ tos1: "Terms of Service 1"
|
||||||
tos2: "Terms of Service 2"
|
tos2: "Terms of Service 2"
|
||||||
|
|
||||||
# Elasticsearcha settings
|
# Elasticsearcha settings
|
||||||
searchhost: "localhost"
|
searchhost: "http://localhost:9200"
|
||||||
searchport: 9200
|
|
||||||
shards: 1
|
shards: 1
|
||||||
replicas: 2
|
replicas: 2
|
||||||
|
|
Loading…
Reference in a new issue