Kibana Search Application Customize Returned Result

Hi ,

Im trying the Kibana Search Applications for the first time. Initially when I created the search application against a certain index I was getting all the fields displayed. After some reading I found that I can you update the search template behind the search application to include certain fields. the steps were as follows:

1- I went to the Kibana Deve Tools and made the following API call to update my search template and return the "text" field using the _source config:

PUT /_application/search_application/my_api_search_application
{
  "indices": [ "openai-chunk-index" ],
  "template": {
    "script": {
      "source": {
      "query":{
      
                "sparse_vector": {
                            "field": "text_embedding",
                            "inference_id": "semantic_elser_model_2",
                            "query": "{{query_string}}"
                        }
                
      
               },
               "_source":"text"
      },
      
      
      "params": {
        "query_string": "*",
        "default_field": "text_embedding"
      }
    }
  }
}

2- Test the the updated Search Application by submitting query as follows:

POST _application/search_application/my_api_search_application/_search
{
  "params": {
    "query_string": "Some Query..."}
    
}

The response I got return the text field as expected:

{
  "took": 86,
  "timed_out": false,
  "_shards": {
    "total": 1,
    "successful": 1,
    "skipped": 0,
    "failed": 0
  },
  "hits": {
    "total": {
      "value": 381,
      "relation": "eq"
    },
    "max_score": 18.074097,
    "hits": [
      {
        "_index": "openai-chunk-index",
        "_id": "Ll6gCJQBxHM1tEFFR1rj",
        "_score": 18.074097,
        "_source": {
          "text": """....Some Text"""
        }
      }

My problem is when I go back to the search application my_api_search_application and open the view with the search bar I still get all the fields when I search for the same query :slight_smile:

Why is that ? Can someone point me what am I doing wrong. I understand its Beta version and things might not work perfectly but is that the expected behavior or its a bug or am I missing something?

Thanks