Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Discover] Show the fetched Discover results even when histogram request fails #198496

Closed
jughosta opened this issue Oct 31, 2024 · 1 comment · Fixed by #198553
Closed

[Discover] Show the fetched Discover results even when histogram request fails #198496

jughosta opened this issue Oct 31, 2024 · 1 comment · Fixed by #198553
Assignees
Labels
bug Fixes for quality problems that affect the customer experience impact:high Addressing this issue will have a high level of impact on the quality/strength of our product. Team:DataDiscovery Discover, search (e.g. data plugin and KQL), data views, saved searches. For ES|QL, use Team:ES|QL.

Comments

@jughosta
Copy link
Contributor

jughosta commented Oct 31, 2024

Describe the bug:
Discover relies on the histogram request to report the total number of hits and it fetches the actual results separately. Currently, for some reason if the histogram request fails, Discover does not handle this error well and shows that "No results found".

Steps to reproduce:

  1. Add breakdownField:fieldName to the URL state where fieldName is any non-aggregatable field (with disabled fielddata)
  2. Observe that Discover shows "No results" screen although Discover fetched results successfully (Inspect panel can show them)

Error example:

"reason": {
            "type": "illegal_argument_exception",
            "reason": "Fielddata is disabled on [log.level] in [filebeat-9.0.0]. Text fields are not optimised for operations that require per-document field data like aggregations and sorting, so these operations are disabled by default. Please use a keyword field instead. Alternatively, set fielddata=true on [log.level] in order to load field data by uninverting the inverted index. Note that this can use significant memory."
          }

Expected behavior:
Discover should display the error/warning next to the vis section and render the fetched results if any.

@jughosta jughosta added bug Fixes for quality problems that affect the customer experience impact:high Addressing this issue will have a high level of impact on the quality/strength of our product. Team:DataDiscovery Discover, search (e.g. data plugin and KQL), data views, saved searches. For ES|QL, use Team:ES|QL. labels Oct 31, 2024
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-data-discovery (Team:DataDiscovery)

@jughosta jughosta self-assigned this Oct 31, 2024
jughosta added a commit that referenced this issue Nov 6, 2024
…est fails on some shards (#198553)

- Closes #198496

## Summary

This PR fixes an issue when the histogram request returns only a partial
result (0 or greater than 0) by adding a warning icon next to the total
hits counter and not blocking the whole page with "No results" message
(when partial result with 0 hits from histogram).

<img width="1436" alt="Screenshot 2024-10-31 at 15 45 17"
src="https://github.com/user-attachments/assets/9a769fe6-bdcf-4d20-ae6e-698a5b08d76f">

### Testing

Execute the following and open `example*` data view in Discover.

```
PUT example1
PUT example1/_mapping
{
  "properties": {
    "message": {
      "type": "text"
    },
    "date": {
      "type": "date"
    }
  }
}
PUT example1/_doc/11
{
    "message": "11",
    "date": "2024-11-11T12:10:30Z"
}
PUT example1/_doc/12
{
    "message": "22",
    "date": "2024-11-12T12:10:30Z"
}

PUT example2
PUT example2/_mapping
{
  "properties": {
    "message": {
      "type": "keyword"
    },
    "date": {
      "type": "date"
    }
  }
}
PUT example2/_doc/21
{
    "message": "21",
    "date": "2024-12-01T12:10:30Z"
}
PUT example2/_doc/22
{
    "message": "22",
    "date": "2024-12-02T12:10:30Z"
}
```

Then add `message` as a breakdown field.

Notice that the histogram gets some partial results:
<img width="1563" alt="Screenshot 2024-10-31 at 16 11 14"
src="https://github.com/user-attachments/assets/8a53f661-38a2-48f8-b082-823de77ac4f2">

Now, add a filter for `_id: 11` and notice that the histogram request
has no results (it partially failed on some shards) but Discover still
renders the table:
<img width="1564" alt="Screenshot 2024-10-31 at 16 11 31"
src="https://github.com/user-attachments/assets/e154ab5d-c5d4-4703-abd4-7bf3cd7a15fb">


### Checklist

- [x] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)
- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios

---------

Co-authored-by: Davis McPhee <[email protected]>
kibanamachine pushed a commit to kibanamachine/kibana that referenced this issue Nov 6, 2024
…est fails on some shards (elastic#198553)

- Closes elastic#198496

## Summary

This PR fixes an issue when the histogram request returns only a partial
result (0 or greater than 0) by adding a warning icon next to the total
hits counter and not blocking the whole page with "No results" message
(when partial result with 0 hits from histogram).

<img width="1436" alt="Screenshot 2024-10-31 at 15 45 17"
src="https://github.com/user-attachments/assets/9a769fe6-bdcf-4d20-ae6e-698a5b08d76f">

### Testing

Execute the following and open `example*` data view in Discover.

```
PUT example1
PUT example1/_mapping
{
  "properties": {
    "message": {
      "type": "text"
    },
    "date": {
      "type": "date"
    }
  }
}
PUT example1/_doc/11
{
    "message": "11",
    "date": "2024-11-11T12:10:30Z"
}
PUT example1/_doc/12
{
    "message": "22",
    "date": "2024-11-12T12:10:30Z"
}

PUT example2
PUT example2/_mapping
{
  "properties": {
    "message": {
      "type": "keyword"
    },
    "date": {
      "type": "date"
    }
  }
}
PUT example2/_doc/21
{
    "message": "21",
    "date": "2024-12-01T12:10:30Z"
}
PUT example2/_doc/22
{
    "message": "22",
    "date": "2024-12-02T12:10:30Z"
}
```

Then add `message` as a breakdown field.

Notice that the histogram gets some partial results:
<img width="1563" alt="Screenshot 2024-10-31 at 16 11 14"
src="https://github.com/user-attachments/assets/8a53f661-38a2-48f8-b082-823de77ac4f2">

Now, add a filter for `_id: 11` and notice that the histogram request
has no results (it partially failed on some shards) but Discover still
renders the table:
<img width="1564" alt="Screenshot 2024-10-31 at 16 11 31"
src="https://github.com/user-attachments/assets/e154ab5d-c5d4-4703-abd4-7bf3cd7a15fb">

### Checklist

- [x] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)
- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios

---------

Co-authored-by: Davis McPhee <[email protected]>
(cherry picked from commit c1e00a8)
kibanamachine pushed a commit to kibanamachine/kibana that referenced this issue Nov 6, 2024
…est fails on some shards (elastic#198553)

- Closes elastic#198496

## Summary

This PR fixes an issue when the histogram request returns only a partial
result (0 or greater than 0) by adding a warning icon next to the total
hits counter and not blocking the whole page with "No results" message
(when partial result with 0 hits from histogram).

<img width="1436" alt="Screenshot 2024-10-31 at 15 45 17"
src="https://github.com/user-attachments/assets/9a769fe6-bdcf-4d20-ae6e-698a5b08d76f">

### Testing

Execute the following and open `example*` data view in Discover.

```
PUT example1
PUT example1/_mapping
{
  "properties": {
    "message": {
      "type": "text"
    },
    "date": {
      "type": "date"
    }
  }
}
PUT example1/_doc/11
{
    "message": "11",
    "date": "2024-11-11T12:10:30Z"
}
PUT example1/_doc/12
{
    "message": "22",
    "date": "2024-11-12T12:10:30Z"
}

PUT example2
PUT example2/_mapping
{
  "properties": {
    "message": {
      "type": "keyword"
    },
    "date": {
      "type": "date"
    }
  }
}
PUT example2/_doc/21
{
    "message": "21",
    "date": "2024-12-01T12:10:30Z"
}
PUT example2/_doc/22
{
    "message": "22",
    "date": "2024-12-02T12:10:30Z"
}
```

Then add `message` as a breakdown field.

Notice that the histogram gets some partial results:
<img width="1563" alt="Screenshot 2024-10-31 at 16 11 14"
src="https://github.com/user-attachments/assets/8a53f661-38a2-48f8-b082-823de77ac4f2">

Now, add a filter for `_id: 11` and notice that the histogram request
has no results (it partially failed on some shards) but Discover still
renders the table:
<img width="1564" alt="Screenshot 2024-10-31 at 16 11 31"
src="https://github.com/user-attachments/assets/e154ab5d-c5d4-4703-abd4-7bf3cd7a15fb">

### Checklist

- [x] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)
- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios

---------

Co-authored-by: Davis McPhee <[email protected]>
(cherry picked from commit c1e00a8)
mgadewoll pushed a commit to mgadewoll/kibana that referenced this issue Nov 7, 2024
…est fails on some shards (elastic#198553)

- Closes elastic#198496

## Summary

This PR fixes an issue when the histogram request returns only a partial
result (0 or greater than 0) by adding a warning icon next to the total
hits counter and not blocking the whole page with "No results" message
(when partial result with 0 hits from histogram).

<img width="1436" alt="Screenshot 2024-10-31 at 15 45 17"
src="https://github.com/user-attachments/assets/9a769fe6-bdcf-4d20-ae6e-698a5b08d76f">

### Testing

Execute the following and open `example*` data view in Discover.

```
PUT example1
PUT example1/_mapping
{
  "properties": {
    "message": {
      "type": "text"
    },
    "date": {
      "type": "date"
    }
  }
}
PUT example1/_doc/11
{
    "message": "11",
    "date": "2024-11-11T12:10:30Z"
}
PUT example1/_doc/12
{
    "message": "22",
    "date": "2024-11-12T12:10:30Z"
}

PUT example2
PUT example2/_mapping
{
  "properties": {
    "message": {
      "type": "keyword"
    },
    "date": {
      "type": "date"
    }
  }
}
PUT example2/_doc/21
{
    "message": "21",
    "date": "2024-12-01T12:10:30Z"
}
PUT example2/_doc/22
{
    "message": "22",
    "date": "2024-12-02T12:10:30Z"
}
```

Then add `message` as a breakdown field.

Notice that the histogram gets some partial results:
<img width="1563" alt="Screenshot 2024-10-31 at 16 11 14"
src="https://github.com/user-attachments/assets/8a53f661-38a2-48f8-b082-823de77ac4f2">

Now, add a filter for `_id: 11` and notice that the histogram request
has no results (it partially failed on some shards) but Discover still
renders the table:
<img width="1564" alt="Screenshot 2024-10-31 at 16 11 31"
src="https://github.com/user-attachments/assets/e154ab5d-c5d4-4703-abd4-7bf3cd7a15fb">


### Checklist

- [x] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)
- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios

---------

Co-authored-by: Davis McPhee <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Fixes for quality problems that affect the customer experience impact:high Addressing this issue will have a high level of impact on the quality/strength of our product. Team:DataDiscovery Discover, search (e.g. data plugin and KQL), data views, saved searches. For ES|QL, use Team:ES|QL.
Projects
None yet
2 participants