# Sorting problem on sparse fields

**URL:** <https://discuss.elastic.co/t/sorting-problem-on-sparse-fields/160564>\
**Category:** Elasticsearch\
**Created:** [December 12, 2018, 3:03pm UTC](https://discuss.elastic.co/t/sorting-problem-on-sparse-fields/160564 "2018-12-12T15:03:01Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![fmhwong](https://avatars.discourse-cdn.com/v4/letter/f/f0a364/32.png) [@fmhwong](https://discuss.elastic.co/u/fmhwong)\
**Post date:** [December 12, 2018, 3:03pm UTC](https://discuss.elastic.co/t/sorting-problem-on-sparse-fields/160564/1 "2018-12-12T15:03:01Z")

</div>

I have multiple types of documents in one index. Most of the documents are type 1. When the first document from type 2 added to the index, the visualization failed to return the document and I got "Request Timeout after 30000ms".

The visualization has a filter to include type 2 documents only and sort on a new field in type 2 which does not exist in type 1 documents.

Does anyone know how to solve the timeout issue?

(I have also posted this in Kibana forum but got no response.)

---

<div class="post-metadata">

**Author:** ![xavierfacq](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/xavierfacq/32/8744_2.png) [@xavierfacq](https://discuss.elastic.co/u/xavierfacq)\
**Post date:** [December 13, 2018, 9:44am UTC](https://discuss.elastic.co/t/sorting-problem-on-sparse-fields/160564/2 "2018-12-13T09:44:10Z")

</div>

Hi,

May be you need to give more details: Version, logs, errors, And don't hesitate to say "hi" and "thank you", it helps.

bye,  
Xavier

---

<div class="post-metadata">

**Author:** ![fmhwong](https://avatars.discourse-cdn.com/v4/letter/f/f0a364/32.png) [@fmhwong](https://discuss.elastic.co/u/fmhwong)\
**Post date:** [December 13, 2018, 2:32pm UTC](https://discuss.elastic.co/t/sorting-problem-on-sparse-fields/160564/3 "2018-12-13T14:32:57Z")

</div>

Hi Xavier,

Thanks for your reply! ES and Kibana are both version is 5.5.1.

Let's say I have 2 type of documents, type1 and type2.

type1 has fields: type, field1, field2, field3, ...  
type2 has fields: type, field1, sequence

I have a lot of type1 documents in ES. When I added the first type2, I ran a query with sorting on sequence.keyword. Kibana timed out and I got "Request Timeout after 30000ms".

---

<div class="post-metadata">

**Author:** ![xavierfacq](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/xavierfacq/32/8744_2.png) [@xavierfacq](https://discuss.elastic.co/u/xavierfacq)\
**Post date:** [December 13, 2018, 3:45pm UTC](https://discuss.elastic.co/t/sorting-problem-on-sparse-fields/160564/4 "2018-12-13T15:45:12Z")

</div>

Hi,

Ok, can you look at the log file of elasticsearch if there is some errors ? May be the query is not good and Kibana doesn't figured out.

---

<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:** [January 10, 2019, 3:45pm UTC](https://discuss.elastic.co/t/sorting-problem-on-sparse-fields/160564/5 "2019-01-10T15:45:15Z")

</div>

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