Skip to content

Instantly share code, notes, and snippets.

@pkmnfrk
Created March 22, 2017 18:43
Show Gist options
  • Save pkmnfrk/746d021f075fe6af4bea1f6269303bf5 to your computer and use it in GitHub Desktop.
Save pkmnfrk/746d021f075fe6af4bea1f6269303bf5 to your computer and use it in GitHub Desktop.
REDIS="redis-cli -n 1"
#echo Module version:
#$REDIS module list
#echo
echo Recreate index:
$REDIS FT.CREATE test SCHEMA body TEXT WEIGHT 1
echo
echo Add data:
$REDIS FT.ADD test d1 1 FIELDS body "The rain in spain falls mainly in the plains"
$REDIS FT.ADD test d2 1 FIELDS body "Go and catch the train!"
$REDIS FT.ADD test d3 1 FIELDS body "This has nothing to do with the rest"
echo
echo Index stats:
$REDIS FT.INFO test
echo
echo Query:
$REDIS FT.SEARCH test rain
echo
echo Drop index:
$REDIS FT.DROP test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment