LoginSignup
2
0

More than 3 years have passed since last update.

AWS CloudSearch の Suggester を JSON で設定する

Last updated at Posted at 2019-11-12

AWS CLI で CloudSearch の Suggester を設定しようとして、少し迷ったため、備忘録として置いておきます。

ファイルの設置

設定したいパラメータを入れた json を適当な場所に設置しておきます。

  • name.json
{
  "SuggesterName": "name",
  "DocumentSuggesterOptions": {
    "SourceField": "name",
    "FuzzyMatching": "low"
  }
}

実行

置いた Json を指定して command line で実行する。

$ aws cloudsearch define-suggester --domain-name $domain --cli-input-json file://$file

複数設定する場合

#!/bin/sh

domain=$1
json_files_path="../config"

if [ -z $domain ]; then
    echo "usage: mkfield <domain> <mode>"
    echo ""
    echo "domain: `aws cloudsearch list-domain-names`"
    echo ""
    exit -1
fi

for file in `\find $json_files_path -name '*.json' | sort`; do
    echo ""
    echo "############################"
    echo "run... aws cloudsearch define-suggester --domain-name $domain --cli-input-json file://$file"
    aws cloudsearch define-suggester --domain-name $domain --cli-input-json file://$file
done

exit 0
done
2
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
0