Function insert

Source
pub async fn insert(
    configuration: &Configuration,
    insert_document_request: InsertDocumentRequest,
) -> Result<SuccessResponse, Error<InsertError>>
Expand description

Insert a document. Expects an object like: { 'index':'movies', 'id':701, 'doc': { 'title':'This is an old movie', 'plot':'A secret team goes to North Pole', 'year':1950, 'rating':9.5, 'lat':60.4, 'lon':51.99, 'advise':'PG-13', 'meta':'{\"keywords\":{\"travel\",\"ice\"},\"genre\":{\"adventure\"}}', 'language':[2,3] } } The document id can also be missing, in which case an autogenerated one will be used: { 'index':'movies', 'doc': { 'title':'This is a new movie', 'plot':'A secret team goes to North Pole', 'year':2020, 'rating':9.5, 'lat':60.4, 'lon':51.99, 'advise':'PG-13', 'meta':'{\"keywords\":{\"travel\",\"ice\"},\"genre\":{\"adventure\"}}', 'language':[2,3] } } It responds with an object in format: {'_index':'products','_id':701,'created':true,'result':'created','status':201}