opensearch-project / OpenSearch-Dashboards

📊 Open source visualization dashboards for OpenSearch.
https://opensearch.org/docs/latest/dashboards/index/
Apache License 2.0
1.69k stars 892 forks source link

[Feature] rank_feature field type is supported in OS but not in OSD #1712

Open CCongWang opened 2 years ago

CCongWang commented 2 years ago

Describe the bug

A rank_feature field behaves as expected when running search queries with it, however it is displayed as unknown in both discovery page and Stack Management -> Index patterns page. The rank_feature feature seems to be added or fixed in this OpenSearch issue https://github.com/opensearch-project/OpenSearch/issues/977, but not in OpenSearch Dashboards.

To Reproduce

  1. Created the Index test with the Following Mapping:
    PUT /test
    {
    "mappings": {
    "properties": {
      "pagerank": {
        "type": "rank_feature"
      },
      "url_length": {
        "type": "rank_feature",
        "positive_score_impact": false
      },
      "topics": {
        "type": "rank_features"
      }
    }
    }
    }
  2. Indexed following Two Documents -
    
    PUT /test/_doc/1?refresh
    {
    "url": "https://en.wikipedia.org/wiki/2016_Summer_Olympics",
    "content": "Rio 2016",
    "pagerank": 50.3,
    "url_length": 42,
    "topics": {
    "sports": 50,
    "brazil": 30
    }
    }

PUT /test/_doc/2?refresh { "url": "https://en.wikipedia.org/wiki/2016_Brazilian_Grand_Prix", "content": "Formula One motor race held on 13 November 2016", "pagerank": 50.3, "url_length": 47, "topics": { "sports": 35, "formula one": 65, "brazil": 20 } }

3. Could Run the below Query, without any exception/error.

GET /test/_search { "query": { "rank_feature": { "field": "pagerank", "linear": {} } } }


4. On creating the Index Pattern test*, could observe that fields like - pagerrank, topics had type as unknown. As seen below -
![image](https://user-images.githubusercontent.com/99116880/172897966-a464d417-631f-4aa3-96ea-c13c0d156bc2.png)

5. On the Discover Page, also could see the Type was unknown for the mentioned fields.
![image](https://user-images.githubusercontent.com/99116880/172898047-abd785ae-4679-4aac-a9ec-5db4fd233d90.png)

**Expected behavior**
`rank_feature` should be recognized in OSD

**OpenSearch Version**
1.2

**Dashboards Version**
1.2
kavilla commented 2 years ago

[Triage]: Updated to feature to add support for this type.