# Could not able to export the data to ElasticSearch

**URL:** <https://discuss.hail.is/t/could-not-able-to-export-the-data-to-elasticsearch/828>\
**Category:** Hail Query & hailctl\
**Created:** [January 9, 2019, 4:46pm UTC](https://discuss.hail.is/t/could-not-able-to-export-the-data-to-elasticsearch/828 "2019-01-09T16:46:39Z")\
**Posts on this page:** 6\
**Page:** 2

<div class="post-metadata">

**Author:** ![tpoterba](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.hail.is/tpoterba/32/61_2.png) [@tpoterba](https://discuss.hail.is/u/tpoterba)\
**Post date:** [February 7, 2019, 5:07pm UTC](https://discuss.hail.is/t/could-not-able-to-export-the-data-to-elasticsearch/828/21 "2019-02-07T17:07:13Z")

</div>

You’ll need to create an entirely new reference genome – not add sequence to GRCh37 (this is used to add a fasta file for reference base lookups).

This will look something like

```python
hs37d5 = hl.ReferenceGenome(name='hs37d5', contigs=['1', '2', '3', ...], ...)

```

Then you’ll need to use this reference on import.

---

<div class="post-metadata">

**Author:** ![nara](https://avatars.discourse-cdn.com/v4/letter/n/e5b9ba/32.png) [@nara](https://discuss.hail.is/u/nara)\
**Post date:** [February 8, 2019, 8:12pm UTC](https://discuss.hail.is/t/could-not-able-to-export-the-data-to-elasticsearch/828/22 "2019-02-08T20:12:04Z")

</div>

Thanks @tpoterba, it helps. Great work.

---

<div class="post-metadata">

**Author:** ![nara](https://avatars.discourse-cdn.com/v4/letter/n/e5b9ba/32.png) [@nara](https://discuss.hail.is/u/nara)\
**Post date:** [February 8, 2019, 8:24pm UTC](https://discuss.hail.is/t/could-not-able-to-export-the-data-to-elasticsearch/828/23 "2019-02-08T20:24:00Z")

</div>

Hi @tpoterba,

Is there a way, I can add hs37d5 to the existing contigs of GRCh37?

Thanks

---

<div class="post-metadata">

**Author:** ![tpoterba](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.hail.is/tpoterba/32/61_2.png) [@tpoterba](https://discuss.hail.is/u/tpoterba)\
**Post date:** [February 8, 2019, 8:34pm UTC](https://discuss.hail.is/t/could-not-able-to-export-the-data-to-elasticsearch/828/24 "2019-02-08T20:34:27Z")

</div>

You can build a new reference genome based on GRCh37, but you cannot modify the existing GRCh37 - this is a somewhat nonsensical thing to do, since GRCh37 is a well-defined reference genome and does not contain a hs37d5 contig.

---

<div class="post-metadata">

**Author:** ![nara](https://avatars.discourse-cdn.com/v4/letter/n/e5b9ba/32.png) [@nara](https://discuss.hail.is/u/nara)\
**Post date:** [March 13, 2019, 4:55pm UTC](https://discuss.hail.is/t/could-not-able-to-export-the-data-to-elasticsearch/828/25 "2019-03-13T16:55:44Z")

</div>

Hi Hail team,

While exporting the data to Elasticsearch there is an error in Hail 0.2.11, where I can export the same data in version 0.2.10. I have installed Hail 0.2.10 and I can export the data. Just wanted to report this error.

```
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-3-2faccc96d948> in <module>()
  8 block_size=1000,
  9 config={'es.nodes.wan.only':'true'},
---> 10 verbose=True)

<decorator-gen-1270> in export_elasticsearch(t, host, port, index, index_type, block_size, config, verbose)

~/anaconda3/envs/python3/lib/python3.6/site-packages/hail/typecheck/check.py in wrapper(__original_func, *args, **kwargs)
559 def wrapper(__original_func, *args, **kwargs):
560 args_, kwargs_ = check_all(__original_func, args, kwargs, checkers, is_method=is_method)
--> 561 return __original_func(*args_, **kwargs_)
562 
563 return wrapper

~/anaconda3/envs/python3/lib/python3.6/site-packages/hail/methods/impex.py in export_elasticsearch(t, host, port, index, index_type, block_size, config, verbose)
   2102 :func:`.export_elasticsearch` is EXPERIMENTAL.
   2103 """
-> 2104 Env.hail().io.ElasticsearchConnector.export(t.expand_types()._jt, host, port, index, index_type, block_size, config, verbose)

~/anaconda3/envs/python3/lib/python3.6/site-packages/hail/table.py in __getattr__ (self, item)
 99 return self. __dict__ [item]
100 else:
--> 101 raise AttributeError(get_nice_attr_error(self, item))
102 
103 def _copy_fields_from(self, other: 'ExprContainer'):

AttributeError: Table instance has no attribute '_jt'
```

---

<div class="post-metadata">

**Author:** ![tpoterba](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.hail.is/tpoterba/32/61_2.png) [@tpoterba](https://discuss.hail.is/u/tpoterba)\
**Post date:** [March 14, 2019, 4:40pm UTC](https://discuss.hail.is/t/could-not-able-to-export-the-data-to-elasticsearch/828/26 "2019-03-14T16:40:01Z")

</div>

have a fix in an open pull request:

> <https://github.com/hail-is/hail/pull/5595>

[Previous page](https://discuss.hail.is/t/could-not-able-to-export-the-data-to-elasticsearch/828.md?page=1)
