Skip to content

Commit 3212cb7

Browse files
committed
commenting out example that requires R&R cluster_id
1 parent d33e91b commit 3212cb7

File tree

1 file changed

+25
-25
lines changed

1 file changed

+25
-25
lines changed

examples/document_conversion_v1.py

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -25,20 +25,20 @@
2525
with open(join(dirname(__file__), '../resources/example.html'), 'r') as document:
2626
config = {
2727
'retrieve_and_rank': {
28-
'dry_run':'true'
28+
'dry_run': 'true'
2929
}
3030
}
3131
print(json.dumps(document_conversion.index_document(config=config, document=document), indent=2))
3232

3333
print("########## Example of a dry run of index_document with only metadata ##########")
3434
config = {
3535
'retrieve_and_rank': {
36-
'dry_run':'true'
36+
'dry_run': 'true'
3737
}
3838
}
3939
metadata = {
4040
'metadata': [
41-
{'name':'id', 'value':'12345'}
41+
{'name': 'id', 'value': '12345'}
4242
]
4343
}
4444
print(json.dumps(document_conversion.index_document(config=config, metadata=metadata), indent=2))
@@ -47,12 +47,12 @@
4747
with open(join(dirname(__file__), '../resources/example.html'), 'r') as document:
4848
config = {
4949
'retrieve_and_rank': {
50-
'dry_run':'true'
50+
'dry_run': 'true'
5151
}
5252
}
5353
metadata = {
5454
'metadata': [
55-
{'name':'id', 'value':'12345'}
55+
{'name': 'id', 'value': '12345'}
5656
]
5757
}
5858
print(json.dumps(document_conversion.index_document(config=config, document=document, metadata=metadata), indent=2))
@@ -62,34 +62,34 @@
6262
config = {
6363
'convert_document': {
6464
'normalized_html': {
65-
'exclude_content': {"xpaths":["//body/div"]}
65+
'exclude_content': {"xpaths": ["//body/div"]}
6666
}
6767
},
6868
'retrieve_and_rank': {
69-
'dry_run':'true'
69+
'dry_run': 'true'
7070
}
7171
}
7272
metadata = {
7373
'metadata': [
74-
{'name':'id', 'value':'12345'}
74+
{'name': 'id', 'value': '12345'}
7575
]
7676
}
7777
print(json.dumps(document_conversion.index_document(config=config, document=document, metadata=metadata), indent=2))
7878

79-
print("########## Example of index_document with document, metadata (A service instance id, SOLR cluster id, and "
80-
"a SOLR collection name must be provided from the Retrieve and Rank service in order to index) ##########")
81-
with open(join(dirname(__file__), '../resources/example.html'), 'r') as document:
82-
config = {
83-
'retrieve_and_rank': {
84-
'dry_run':'false',
85-
'service_instance_id':'YOUR RETRIEVE AND RANK SERVICE INSTANCE ID',
86-
'cluster_id':'YOUR RETRIEVE AND RANK SERVICE SOLR CLUSTER ID',
87-
'search_collection':'YOUR RETRIEVE AND RANK SERVICE SOLR SEARCH COLLECTION NAME'
88-
}
89-
}
90-
metadata = {
91-
'metadata': [
92-
{'name':'id', 'value':'12345'}
93-
]
94-
}
95-
print(json.dumps(document_conversion.index_document(config=config, document=document, metadata=metadata), indent=2))
79+
# print("########## Example of index_document with document, metadata (A service instance id, SOLR cluster id, and "
80+
# "a SOLR collection name must be provided from the Retrieve and Rank service in order to index) ##########")
81+
# with open(join(dirname(__file__), '../resources/example.html'), 'r') as document:
82+
# config = {
83+
# 'retrieve_and_rank': {
84+
# 'dry_run': 'false',
85+
# 'service_instance_id': 'YOUR RETRIEVE AND RANK SERVICE INSTANCE ID',
86+
# 'cluster_id': 'YOUR RETRIEVE AND RANK SERVICE SOLR CLUSTER ID',
87+
# 'search_collection': 'YOUR RETRIEVE AND RANK SERVICE SOLR SEARCH COLLECTION NAME'
88+
# }
89+
# }
90+
# metadata = {
91+
# 'metadata': [
92+
# {'name': 'id', 'value': '12345'}
93+
# ]
94+
# }
95+
# print(json.dumps(document_conversion.index_document(config=config, document=document, metadata=metadata), indent=2))

0 commit comments

Comments
 (0)