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

Find objects API do not work properly for index patterns #97600

Closed
al-ah opened this issue Apr 20, 2021 · 7 comments
Closed

Find objects API do not work properly for index patterns #97600

al-ah opened this issue Apr 20, 2021 · 7 comments
Labels
bug Fixes for quality problems that affect the customer experience impact:low Addressing this issue will have a low level of impact on the quality/strength of our product. loe:small Small Level of Effort

Comments

@al-ah
Copy link

al-ah commented Apr 20, 2021

Kibana version:
7.12.0

Describe the bug:
I need to get the index patterns title and fields. Its worked correctly in kibana 7.10 but now if i create new index pattern then get index patterns i have no fields in result.

Steps to reproduce:

  1. post new index :
POST test-1/_doc
{
  "name": "foo",
  "family": "bar"
}

  1. create new index pattern in kibana
    image

  2. use find objects api

/api/saved_objects/_find?type=index-pattern&search=test-*
  1. result in kibana 7.10
    image

  2. result in kibana 7.12
    image

Expected behavior:
With the implementation of Find objects API, it is also necessary to obtain the fields based on the index pattern and bring them in the fields section.

thanks

@al-ah al-ah added the bug Fixes for quality problems that affect the customer experience label Apr 20, 2021
@botelastic botelastic bot added the needs-team Issues missing a team label label Apr 20, 2021
@rashmivkulkarni rashmivkulkarni added the Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc label May 12, 2021
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-core (Team:Core)

@botelastic botelastic bot removed the needs-team Issues missing a team label label May 12, 2021
@dmlemeshko
Copy link
Member

Hi @alah64

Looks like we no longer fetch fields via /api/saved_objects/_find since #83891 (released in 7.12)

Get field mapping API

@elastic/kibana-app-services could you confirm?

@mattkime
Copy link
Contributor

@alah64 You'll get what you need by using the Index Patterns API - #83576 - using other methods (such as the field mapping API) may produce inconsistent results.

@al-ah
Copy link
Author

al-ah commented May 16, 2021

Thank you for your answer.
Because I do not know the names of the fields and I need all the fields at once, Get field mapping API is not applicable.
I will test the Index Patterns API, the only problem is that this method does not exist in versions 7.10 and earlier. I have to find a solution to detect the version in Kibana plugin and go one of the two methods based on it .

@mattkime
Copy link
Contributor

Because I do not know the names of the fields and I need all the fields at once, Get field mapping API is not applicable.

The field caps api might be more appropriate - https://www.elastic.co/guide/en/elasticsearch/reference/current/search-field-caps.html

It depends upon if you want the fields from indices or if you want the fields from an index pattern.

I have to find a solution to detect the version in Kibana plugin and go one of the two methods based on it .

If you're writing a plugin, then you can use the data plugin to access index pattern functionality instead of the index pattern REST API.

@lukeelmers lukeelmers added Team:AppServices and removed Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc labels May 17, 2021
@exalate-issue-sync exalate-issue-sync bot added impact:low Addressing this issue will have a low level of impact on the quality/strength of our product. loe:small Small Level of Effort labels Jun 21, 2021
@mattkime
Copy link
Contributor

mattkime commented Oct 7, 2021

Closing issue as several months have passed. Feel free to reopen if needed.

@mattkime mattkime closed this as completed Oct 7, 2021
@al-ah
Copy link
Author

al-ah commented Jan 20, 2022

This problem does not exist in version 7.16.2 , also can use index patterns api since version 7.12
thanks

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:low Addressing this issue will have a low level of impact on the quality/strength of our product. loe:small Small Level of Effort
Projects
None yet
Development

No branches or pull requests

6 participants