[I accidentally posted this to boto-dev, too many tabs, apologize for the rephrase here but thankfully the -dev group suppressed it]
Another user made a query about boto3 and cloudsearch but I haven't found anything besides this reference:
I can create a cloudsearch domain and indices fine, like:
INDICES = [
{"IndexFieldName": FIELD_MAP["NASA ID"],
"IndexFieldType": "literal",
"LiteralOptions": {
"FacetEnabled": True,
"ReturnEnabled": RETURN_ENABLED,
"SearchEnabled": True,
"SortEnabled": True,
}},
...
]
cloudsearch = boto3.client("cloudsearch")
domain = cloudsearch.create_domain(DomainName=SEARCH_DOMAIN_NAME)
cloudsearch.update_service_access_policies(
DomainName=SEARCH_DOMAIN_NAME,
AccessPolicies=json.dumps(ACCESS_BY_IP),
)
for index in INDICES:
cloudsearch.define_index_field(DomainName=SEARCH_DOMAIN_NAME,
IndexField=index)
and I see it PROCESSING in the console, then I an tell it to reindex. Good so far.
But I can't figure out how to use "cloudsearchdomain" to query or upload to the domain. I don't see any way to specify my domain or its endpoint. The docs say to use the "search" endpoint for searchy stuff, and the "docs" endpoint for uploading, but no way to pass those to boto3.
From the boto3 docs:
cloudsearchdomain = boto3.client('cloudsearchdomain')
response = client.search(query='string')
I presume the first line should say 'client =', not 'cloudsearchdomain' since 'client' is used in all the other examples. But there's no place to specify my domain's name, nor provide the domain-specific endpoint the docs discuss. The first line works, then the second fails:
If I guess that in the docs 'cloudsearchdomain' was really supposed to be the name of my cloudsearch domain, "avail-search-20150513", the client() call fails. It also fails if I try and use various forms of the endpoint:
What am I missing? I presume the documented client() call gets a client, but somehow I need to get a connection to my domain's endpoint for the .search() to query.
Thanks for any clues you can provide.