diff --git a/rel/files/riak-admin b/rel/files/riak-admin index d6c781e42..8d126563d 100755 --- a/rel/files/riak-admin +++ b/rel/files/riak-admin @@ -535,6 +535,10 @@ search_admin() $NODETOOL rpc yz_console switch_to_new_search "$@" ;; + schema) + shift + search_schema_admin "$@" + ;; *) echo "\ Usage: $SCRIPT search @@ -543,6 +547,99 @@ Available commands: aae-status switch-to-new-search + schema +" + esac +} + +search_schema_admin() +{ + case "$1" in + create) + if [ $# -ne 3 ]; then + echo "Usage: $SCRIPT search schema create " + exit 1 + fi + # Make sure the local node is running + node_up_check + $NODETOOL rpc yz_console create_schema "$2" "$3" + ;; + show) + if [ $# -ne 2 ]; then + echo "Usage: $SCRIPT search schema show " + exit 1 + fi + # Make sure the local node is running + node_up_check + $NODETOOL rpc yz_console show_schema "$2" + ;; + *) + SCHEMA="$1" + case "$2" in + add) + shift + search_schema_add_admin "$SCHEMA" "$@" + ;; + remove) + shift + if [ $# -ne 2 ]; then + echo "Usage: $SCRIPT search schema $SCHEMA remove " + exit 1 + fi + # Make sure the local node is running + node_up_check + $NODETOOL rpc yz_console remove_from_schema "$SCHEMA" "$2" + ;; + *) + +echo "\ +Usage: $SCRIPT search schema + +Available commands: + +create +show + add + remove +" + esac;; + esac +} + +search_schema_add_admin() +{ + SCHEMA="$1" + case "$3" in + field) + shift + if [ $# -lt 3 ]; then + echo "Usage: $SCRIPT search schema $SCHEMA add field [