better searchhost configuration

This commit is contained in:
nek0 2015-10-18 02:52:27 +02:00
parent a410e8607b
commit e44d5e4ee1
3 changed files with 8 additions and 12 deletions

View file

@ -151,7 +151,6 @@ deleteIndexES input = do
runBH' action = do
master <- getYesod
let s = appSearchHost $ appSettings master
let p = show $ appSearchPort $ appSettings master
let server = Server $ T.pack $ (T.unpack s) ++ ":" ++ show p
let server = Server s
manager <- liftIO $ newManager defaultManagerSettings
runBH (BHEnv server manager) action

View file

@ -75,10 +75,9 @@ data AppSettings = AppSettings
, appTos1 :: Text
, appTos2 :: Text
-- ^ Terms of Service
, appSearchHost :: Text
, appSearchPort :: Int
, appShards :: Int
, appReplicas :: Int
, appSearchHost :: Text
, appShards :: Int
, appReplicas :: Int
-- ^ Settings for Elasticsearch
}
@ -111,10 +110,9 @@ instance FromJSON AppSettings where
appTos1 <- o .: "tos1"
appTos2 <- o .: "tos2"
appSearchHost <- o .: "searchhost"
appSearchPort <- o .: "searchport"
appShards <- o .: "shards"
appReplicas <- o .: "replicas"
appSearchHost <- o .: "searchhost"
appShards <- o .: "shards"
appReplicas <- o .: "replicas"
return AppSettings {..}

View file

@ -53,7 +53,6 @@ tos1: "Terms of Service 1"
tos2: "Terms of Service 2"
# Elasticsearcha settings
searchhost: "localhost"
searchport: 9200
searchhost: "http://localhost:9200"
shards: 1
replicas: 2