Legacy search endpoints (Apache Solr)

Important

These API endpoints are deprecated and only exist to support older implementations and should not be used for new implementations.

This section details the legacy search endpoints for earlier versions of Helix Search (Apache Solr) that are supported in Helix Search.

Legacy Handshake

Description

HEAD http://localhost:1601/api/search

Convenient method for Commons or other servers that need to check "are you there" on startup. Returns a standard OK message.

Example usage

Check that the Helix Search service is running:

curl -u<user>:<YourTicket> -X HEAD http://localhost:1601/api/search

Helix Search responds with:

{"status":{"code":200,"message":"OK"}}

Legacy simple search

Description

POST http://localhost:1601/api/auth-search

Search results returned in a JSON formatted version of the Helix server p4 files output.

Fields

  • queryRaw : query string,
  • paths: [ { depot path 0 }, {depot path 1}, ...],
  • searchFields: [ { field: Elasticsearch schema field name, value: value to search for }, ... ]
  • rowCount: maximum number of search results,
  • resultFormat:{{DETAILED | SIMPLE}} the default value is SIMPLE - optional
  • startRow: {{DETAILED: result set row to return results from, starting at 0}}: the result set row to return results from, starting at 0 the default value is 0 - optional
  • rowCount: the number of rows to return in the search result, the default value is 0 - optional

Example usage

Search for the query string:

curl -u<user>:<YourTicket> -X POST -d '{"queryRaw":"perl","paths":["//depot/main"],"searchFields":[{"field":"depotpath","value":"depot"},{"field":"depotpath","value":"res"},{"field":"modifiedby","value":"bruno"}],"startRow":0,"rowCount":3,"resultFormat":"SIMPLE"}' http://localhost:1601/api/auth-search

Helix Search responds with:

{
  "status": {
    "code": "200",
    "message": "OK"
  },
  "payload": [
    {
      "depotFile": "//depot/main/p4-perl/packaging/win/res/versions.bat",
      "rev": 3,
      "action": "edit",
      "fileType": "text+x",
      "change": 917315
    },
    ...
  ],
  "indexDate": 1585924773009,
  "productVersion": "unspecified"
}

Legacy detailed search

POST http://localhost:1601/api/auth-search

Returns a detailed file model. If the search returned no results, the payload array will be empty but the status code will be 200 (OK).

File model:

  • detailedFilesModels: contains an array of filesModel objects (the same format as SIMPLE results) paired with the modifiedByUser and score fields
  • fileModelCount: contains the number of elements in detailedFilesModels
  • maxScore: contains the highest score of any of the filesModels
  • lastRow: used to page through the results by setting a future request's startRow value to lastRow + 1

Usage example

curl -u<user>:<YourTicket> -X POST -d '{"queryRaw":"perl","paths":["//depot/min"],"searchFields":[{"field":"depotpath","value":"depot"},{"field":"depotpath","value":"res"},{"field":"modifiedby","value":"bruno"}],"startRow":0,"rowCount":3,"resultFormat":"DETAILED"}' http://localhost:1601/api/auth-search

Helix Search responds with:

{
  "status": {
    "code": "200",
    "message": "OK"
  },
  "payload": {
    "fileModelCount": 3,
    "numFound": 28,
    "maxScore": 6.946503,
    "detailedFilesModels": [
      {
        "filesModel": {
          "time": 0,
          "type": "text+x",
          "depotFile": "//depot/main/p4-perl/packaging/win/res/versions.bat",
          "rev": 3,
          "action": "edit",
          "change": 917315
        },
        "score": 6.946503,
        "modifiedByUser": "bruno"
      },
      ...,
        "score": 6.821844,
        "modifiedByUser": "bruno"
      }
    ],
    "lastRow": 3
  },
  "indexDate": 1585749109685,
  "productVersion": "unspecified"
}