code: func getSearchQueryFromURLPattern(patternName, stringToMatch string) string {
  	pattern := knownURLs[patternName]
  	// TODO : handle case for 0 matches
  	match := pattern.compiledRegex.FindStringSubmatch(stringToMatch)
  	result := make(map[string]string)
  	// result will hold key-value for groupName to its value
  	// e.g> "domain": "demo.almighty.io", "id": 200
  	for i, name := range pattern.groupNamesInRegex {
  		if i == 0 {
  			continue
  		}
  		if i > len(match)-1 {
  			result[name] = ""
  		} else {
  			result[name] = match[i]
  		}
  	}
  	// first value from FindStringSubmatch is always full input itself, hence ignored
  	// Join rest of the tokens to make query like "demo.almighty.io/work-item/list/detail/100"
  	if len(match) > 1 {
  		searchQueryString := strings.Join(match[1:], "")
  		searchQueryString = strings.Replace(searchQueryString, ":", "\\:", -1)
  		// need to escape ":" because this string will go as an input to tsquery
  		searchQueryString = fmt.Sprintf("%s:*", searchQueryString)
  		if result["id"] != "" {
  			// Look for pattern's ID field, if exists update searchQueryString
  			// `*A` is used to add sme weight to the work item number in the search results.
  			// See https://www.postgresql.org/docs/9.6/static/textsearch-controls.html
  			searchQueryString = fmt.Sprintf("(%v:*A | %v)", result["id"], searchQueryString)
  			// searchQueryString = "(" + result["id"] + ":*" + " | " + searchQueryString + ")"
  		}
  		return searchQueryString
  	}
  	return match[0] + ":*"
  }
docs: /*
  getSearchQueryFromURLPattern takes
  patternName - name of the KnownURL
  stringToMatch - search string
  Finds all string match for given pattern
  Iterates over pattern's groupNames and loads respective values into result
  */