https://github.com/codelibs/elasticsearch-abtest
https://github.com/codelibs/elasticsearch-abtest
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/codelibs/elasticsearch-abtest
- Owner: codelibs
- Created: 2015-10-10T09:08:46.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2015-10-16T02:37:28.000Z (over 10 years ago)
- Last Synced: 2025-03-30T18:04:35.650Z (about 1 year ago)
- Language: Java
- Size: 137 KB
- Stars: 4
- Watchers: 8
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# elasticsearch-abtest
## Overview
AbTestPlugin provide simple A/B testing for search request. This plugin rewrite a search target index by [ab_rt] parameter automatically.
## Usage
### Setup test settings
```
curl -XPOST localhost:9201/sample-index/_abtest/settings -d '
{
"testcases": [
{
"test_name": "test1",
"index": "sample-index-a",
"percentage": 10
},
{
"test_name": "test2",
"index": "sample-index-b",
"percentage": 20
}
]
}'
```
### Executing test
A search target index is rewritten by ab_rt parameter. In the above case, if ab_rt parameter is 0-9, target index is rewritten sample-index-a.
Search sample-index
```
curl -XPOST localhost:9200/sample-index/doc/_search?q=*:*
```
Search sample-index-a (ab_rt is 0-9)
```
curl -XPOST localhost:9200/sample-index/doc/_search?q=*:*&ab_rt=5&hash_rt=false
```
Search sample-index-b (ab_rt is 10-29)
```
curl -XPOST localhost:9200/sample-index/doc/_search?q=*:*&ab_rt=20&hash_rt=false
```
If you set "true" to hash_rt parameter, ab_rt parameter value is converted to hashCode.(default)