Searching for tickets via number is not always displayed first in xFlow
search cancel

Searching for tickets via number is not always displayed first in xFlow

book

Article ID: 243595

calendar_today

Updated On:

Products

CA Service Desk Manager CA Service Management - Service Desk Manager

Issue/Introduction

The tickets search result is not in order in Xflow if there is a prefix added for a ticket number

  • Go to Administration -> Requests/Incidents/Problems -> Sequence Numbers -> Request/Incident/Problem Num Sequence and add a Prefix as Req-
  •  Now create few tickets so that the ticket number will have prefix of Req-.
  • Login to Xflow and search for the tickets by giving full number ex: req-176/req-179

  https://api-broadcom-ca.wolkenservicedesk.com/attachment/get_attachment_content?uniqueFileId=GBHpUKsDBtpIk3NRgwo7Ww==

  •  The ticket result is not at the top but at different orders every time.

Environment

Release : 17.3

Component : SDM - xFlow

Cause

Search Server and the xFlow Search Microservice is searching against multiple fields such as summary and description.  The search functionality needs to be adjusted to favour the ref_num field.

Resolution

Please follow below steps to adjust search functionality.  Please backup any configuration files that are mentioned in this article before making any changes.

The changes that will be introduced:

  • Remove the summary and description fields entirely from the xFlow search functionality, leaving just the ref_num field as the field of interest to search against
  • Modify the level of leniency against the search to return more precise results.

1. Go to CA/SC/CASearchServer/search/config/mappings.json and change the following properties.

2. Note:  this step excludes the summary and description fields from the xFlow search functions.  Please skip this step if the summary and description fields should be included as part of the xFlow search.  

Under sdm_index_cr node, change the index property from analyzed to not_analyzed for summary and description nodes and remove the analyzer property

Example for "summary" node:

Original:

        "summary": {
          "type": "string",
          "store": "Yes",
          "boost": 1,
          "term_vector": "no",
          "index": "analyzed",
          "analyzer": "autocomplete_analyzer",
          "norms": {
            "enabled": false
          }
        },

Modified:

        "summary": {
          "type": "string",
          "store": "Yes",
          "boost": 1,
          "term_vector": "no",
          "index": "not_analyzed",
          "norms": {
            "enabled": false
          }
        },

3. Rebuild the ES Index.  Run "pdm_es_rebuild_index" under the C:\Program Files\CA\SC\CASearchServer\search\bin directory in an Admin command prompt.

4. Go to the xFlow server, under searchmicroservice/conf/application.conf and perform the following changes

Uncomment (Remove #) line 118 and remove summary and description. 

Original line:

#esearch.cr.searchable.columns=[ref_num, summary, description]

Modified line:

esearch.cr.searchable.columns=[ref_num]

5.  This step requires some experimentation to yield perfect results. Search for esearch.entity.cr node (around line 289) and under the searchQuery property for this node, tune up the minimum_should_match property to somewhere between 70-80%. This should narrow down the searches to yield better results.

Note:  Please test this with a data set that closely matches what is to be expected in normal user operations.  

Original text:

esearch.entity.cr = {
    name = cr,
    majicName = cr,
    typeName = cr,
    idColumnName = persistent_id,
    idColumnDataType = String,
    selectColumns = [ref_num, summary, description, customer.first_name, customer.last_name, status.desc,external_system_ticket],
    searchColumns = ${?esearch.cr.searchable.columns},
    domsrvrSelectColumns = [],
    searchQuery = """{
      "from" : %d,
      "size" : %d,
      "query" : {
        "bool" : {
          "should" : {
            "multi_match" : {
              "query" : "%s",
              "fields" : %s,
              "minimum_should_match" : "50%%"

Modified text: (changed to 75% for example purposes)

esearch.entity.cr = {
    name = cr,
    majicName = cr,
    typeName = cr,
    idColumnName = persistent_id,
    idColumnDataType = String,
    selectColumns = [ref_num, summary, description, customer.first_name, customer.last_name, status.desc,external_system_ticket],
    searchColumns = ${?esearch.cr.searchable.columns},
    domsrvrSelectColumns = [],
    searchQuery = """{
      "from" : %d,
      "size" : %d,
      "query" : {
        "bool" : {
          "should" : {
            "multi_match" : {
              "query" : "%s",
              "fields" : %s,
            "minimum_should_match" : "75%%"

6. Restart the xFlow Services.

Additional Information

The above changes are global and will affect all users who are accessing the xFlow functionality.  It is not possible to adjust this functionality to apply to select users.

Skipping step 2, which excludes the summary and description fields from the xFlow search function, may cause the search to return results in which a match that is found against these fields, and may take precedence over a ref_num field match. 

Service Point search functionality should not be affected as its search features follow a different design philosophy that xFlow.