NewsSearchServer Diving Deep

What is it, NSS is a Http service that takes a search criteria and generates results from it, returning it to the requester.

The search input format: POST of http://<host>/news/search?params; POST data being the search meta data + search criteria

Search meta information sample: {“databases”:[ {“databases”:[“BW”], “start_date”:”20090901″, “end_date”:”20090905″}, {“databases”:[“FRC”]} ], “returned_fields”:[“headline”,”story_date”,”story_time”,”product”], “search_timeout”:28000, “max_docs”:200, “sort_spec”:”story_date ASC”, “start_date”:”20090805″, “end_date”:”20090905″ }

NSS support text search

Now the crux is to be clear on parameters of page and max_docs setting.

“max_docs” is (optional) max documents to return, possibly per-feed. (default=100),

  • If no “page” is specified, max_docs is the number of documents on a per feed basis to return.
  • If “page” is specified, max_docs is interpreted to be the total number of documents to return across all feeds (in other words, the page-size).

“page” is (optional) Which page of the results you want returned (with some side effects), the first page being page=1. When specifying a page number, results will be returned with different feeds intermixed, all documents being sorted by the specified sort-spec. Max_docs will be interpreted to be the page-size.

  1. Page Size Limit: The documentation states:
    • max_docs: “The maximum number of documents to retrieve per page. The default is 25. The maximum value is 100.”
    • This means each page can return up to 100 records.
  2. Page Number Limit: The documentation shows:
    • page: “The page number of the search results to return. The default is 1. The maximum value is 3.”
    • This explicitly states that the API will only return up to 3 pages of results, regardless of how many total matches exist.
  3. Maximum Results: This means the absolute maximum number of results you can get from a single search is:
    • 3 pages × 100 records per page = 300 records maximum

The nss function in your code is working as designed – it will keep requesting pages until either:

  1. It gets fewer than max_results_per_page results (indicating the last page)
  2. It hits the 3-page limit enforced by the API

This is a server-side limitation of the FactSet NSS API. To work around this, you would need to:

  1. Make your search criteria more specific to reduce the number of results
  2. Break your search into smaller date ranges
  3. If possible, use additional filters to narrow down the results

Note batch size split list of entiteis into smaller grouups, each batch is processed with a seprate API call, it helps avoid overwhelming the API with too many entities in a single request.
while pagination limits enforced on the server size has a max of 100 docs/records per page and max 3 pages per request, this applies to each invidividual API call, i.e. each batch.
if need more search results, need to make search criteria more specific, break down the time period into smaller chunks and use additional filters if available.

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.