# Create a url field pyelasticsearch python

**URL:** <https://discuss.elastic.co/t/create-a-url-field-pyelasticsearch-python/263047>\
**Category:** Elasticsearch\
**Created:** [February 2, 2021, 9:37pm UTC](https://discuss.elastic.co/t/create-a-url-field-pyelasticsearch-python/263047 "2021-02-02T21:37:44Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tlm\_Konstantinos](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tlm_konstantinos/32/78397_2.png) [@Tlm\_Konstantinos](https://discuss.elastic.co/u/Tlm_Konstantinos)\
**Post date:** [February 2, 2021, 9:37pm UTC](https://discuss.elastic.co/t/create-a-url-field-pyelasticsearch-python/263047/1 "2021-02-02T21:37:45Z")

</div>

I am using in python the module pyelasticsearch v7.10.1 and I am trying to update a document in one index in the elasticsearch server. What should I do if I want to create a hyperlink field during the update?

```auto
source_to_update = {

                    "doc": {
                        "x": "val of x",
                        "y": "val of y",
                        "urlfield": ???"www.google.com" }
}
                try:
                    response = es.update(
                        index=index,
                        doc_type="_doc",
                        id=doc['_id'],
                        body=source_to_update
                    )

                except Exception as err:
                    print('Elasticsearch Update API error:', err)

```

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [March 2, 2021, 9:38pm UTC](https://discuss.elastic.co/t/create-a-url-field-pyelasticsearch-python/263047/2 "2021-03-02T21:38:20Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
