mirror of
https://github.com/elastic/elasticsearch.git
synced 2025-06-28 17:34:17 -04:00
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:
parent
6714e02bef
commit
613a1a6a18
10 changed files with 32 additions and 0 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue