It's for translating response status into Caché status. I have the following code:

ClassMethod GetResponseStatus(Request As %Net.HttpRequest) As %Status
{
    Set Status = Request.HttpResponse.StatusCode
    Quit:(Status = 200) $$$OK
    Set Body = Request.HttpResponse.Data.Read($$$MaxCacheInt)
    Quit $$$ERROR($$$GeneralError,"Status code: " _ Status _ " ReasonPhrase: " _ Request.HttpResponse.ReasonPhrase _ " StatusLine: " _ Request.HttpResponse.StatusLine _ " Body: " _ Body)
}

And I want to add URL reporting to it.

You can open this (any) method in Studio and see the definition (with some rare exceptions, in iKnow package only  %iKnow.TextTransformation.HeaderRepositorySetArray and %iKnow.TextTransformation.KeyRepositorySetArray classes are not availible). It's the best way to get an idea of how method works and the code usually even has comments.

Scrapped from GetSimilar():

  1. Select the most probably relevant terms in the source (top N)
  2. Select all sources containing at least one of these N target elements
  3. Sort these candidates by the number of target elements they share with the  reference documents (approximate score)
  4. Of these sources, calculate the actual similarity score for the top M sources with the best approximate score
  5. Now store the page window in the final result PPG

Hi. About your second question, you can easily extend Caché ObjectScript, to do it. Wouldn't recommend it for use in production, but why not add some syntax sugar on you dev instance?

Create %ZLANGC00 mac routine with the following code:

 ; %ZLANGC00
 ; custom commands for ObjectScript
 ; http://docs.intersystems.com/cache20141/csp/docbook/DocBook.UI.Page.cls?KEY=GSTU_customize
  Quit  

/// Execute Query and display the results
/// Call like this:
/// zsql "SELECT TOP 10 Name FROM Sample.Person"
ZSQL(Query)
  #Dim ResultSet As %SQL.StatementResult
  Set ResultSet = ##class(%SQL.Statement).%ExecDirect(, Query)
  Do ResultSet.%Display()
  Quit

Save and compile it and then you can execute sql in a terminal like this:

zsql "SELECT TOP 10 Name FROM Sample.Person"

It would display something like this:

SAMPLES>zsql "SELECT TOP 10 Name FROM Sample.Person"
Name
Adam,Wolfgang F.
Adams,Phil H.
Ahmed,Edward V.
Ahmed,Michael O.
Ahmed,Patrick O.
Allen,Zelda P.
Alton,Samantha F.
Bach,Buzz E.
Bach,Fred X.
Bach,Patrick Y.
 
10 Rows(s) Affected

That said I myself prefer executing SQL queries in SMP because you don't need to type them there (drag&drop from the left panel or copy&paste from the code) - it's very convenient.