Help us understand the problem. What is going on with this article?

AWS CloudSearch の Suggester を JSON で設定する

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
Why do not you register as a user and use Qiita more conveniently?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away