Last active
August 29, 2015 13:57
-
-
Save nik9000/9528170 to your computer and use it in GitHub Desktop.
Benchmark suggest
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
function benchmark() { | |
echo -n "$1" | |
echo ' | |
{ | |
"size": 0, | |
"suggest": { | |
"text": "'$2'", | |
"title": { | |
"phrase": { | |
"field": "title", | |
"size": 1, | |
"max_errors": 2, | |
"confidence": 2, | |
"direct_generator": [ | |
{ | |
"field": "title", | |
"suggest_mode": "always", | |
"max_term_freq": 0.5 | |
} | |
] | |
} | |
} | |
} | |
}' > request_body | |
ab -c 3 -n 200 -p request_body http://localhost:9200/test/_search 2>&1 | grep Total: | |
} | |
benchmark 'Short ' 'unitedd' | |
benchmark 'Nobel ' 'noble prize' | |
benchmark 'Medium ' 'united states house of representatives' | |
benchmark 'Long ' 'united states house of representatives elections in washington 2006' | |
benchmark '1 ' 'Credit card with lowest interest rate' | |
benchmark '2 ' 'list of the cities in missouri' | |
benchmark '3 ' 'pressure & ventilation system normal standard pressure value in pascal' | |
benchmark '4 ' 'Queen Elizabeth I of England belongs to which dynasty' | |
benchmark 'Troll ' 'united states united states united states united states united states united states just trolling' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment