Add stored binary fields to static backwards compatibility indices tests (#22054)

Add stored binary fields to static backwards compatibility indices tests
This commit is contained in:
Michael McCandless 2016-12-09 05:32:40 -05:00 committed by GitHub
parent 6714e02bef
commit 613a1a6a18
10 changed files with 32 additions and 0 deletions

View file

@ -15,6 +15,7 @@
# language governing permissions and limitations under the License.
import argparse
import base64
import glob
import logging
import os
@ -73,6 +74,8 @@ def index(es, index_name, type, num_docs, supports_dots_in_field_names, flush=Fa
if supports_dots_in_field_names:
body['field.with.dots'] = str(random.randint(0, 100))
body['binary'] = base64.b64encode(bytearray(random.getrandbits(8) for _ in range(16))).decode('ascii')
es.index(index=index_name, doc_type=type, id=id, body=body)
if rarely():
@ -334,6 +337,12 @@ def generate_index(client, version, index_name):
}
})
# test back-compat of stored binary fields
mappings['doc']['properties']['binary'] = {
'type': 'binary',
'store': True,
}
settings = {
'number_of_shards': 1,
'number_of_replicas': 0,