question

Upvotes
Accepted
6 3 6 7

Search API returns some results that do not match the requested view

I am using the .net RDP library Search.Definition.

When using the View: "CommodityQuotes" and and the filter "DTSubjectName eq 'milk'" the API returns some values of the asset category "Energy/Energy Statistics" for example "DIY-WMKP-GDT" (Global Dairy Trade Whole Milk Powder) looking at the ric in Workspace it seems to be a commodity.

Is this an intended result, a data mistake or a problem with the API?

rdp-apirefinitiv-data-platform.netsearchrefinitiv-data-platform-libraries
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvote
Accepted
7.6k 15 6 9

I'm not a content expert, but I can help you verify if it can provide the same data sent by the Search service. I believe that you are using 2.6.01-Search-SearchService.

I have removed original codes and queries and then modified the example to use CommodityQuotes view and use filter "DTSubjectName eq 'milk' but still unable to find the result you mentioned.

     var request = Search.Definition(Search.View.CommodityQuotes).Filter("DTSubjectName eq 'milk'");
     DisplayResponse($"\nActive RICs DTSubjectName eq 'milk'. ", request, "RIC");


Below is the output


10/28/2020 10:00:38 AM:Session is Pending. (State: Pending)
10/28/2020 10:00:42 AM:{
  "Contents": "Platform Session Successfully Authenticated"
}. (Event: SessionAuthenticationSuccess)
10/28/2020 10:00:42 AM:Session is Opened. (State: Opened)


Active RICs DTSubjectName eq 'milk'.


Max available hits: 109347.
Requested for 10 (Default) hits.  Received: 10

1. CME Class 3 Milk Pit Commodity Option Chain Contracts, Commodity Future Option, CME:Index and Options Market
        RIC: 0#2DCS+
2. CME Class III Mid-Sized Milk Pit Commodity Option Chain Contracts, Commodity Future Option, CME:Index and Options Market
        RIC: 0#2JQ+
3. Farmgate Milk Price United Kingdom Chain, Commodity Spot, UK DEPT FOR ENVIRONMENT FOOD & RURAL AFFAIRS
        RIC: 0#DEFRA-UKFGM
4. China Customs Milk Powder Imports, Energy Statistic, General Administration of Customs of China
        RIC: CNC-MLKPWD-IMP
5. CME Class III Mid-Sized Milk Pit Commodity Continuation Option Chain Contracts, Commodity Cash Option, CME:Index and Options Market
        RIC: 0#2JQ++
6. CME Class 3 Milk Pit Commodity Continuation Option Chain Contracts, Commodity Cash Option, CME:Index and Options Market
        RIC: 0#2DCS++
7. CME Class III Mid-Sized Milk Pit ATM Commodity Option Chain Contract, Commodity Cash Option, CME:Index and Options Market
        RIC: 0#2JQ+++
8. CME Class 3 Milk Pit ATM Commodity Option Chain Contract, Commodity Cash Option, CME:Index and Options Market
        RIC: 0#2DCS+++
9. New zealand Derivative Exchange Whole Milk Powder Commodity Future Continuation 1, Commodity Future, New Zealand Stock Exchange
        RIC: NWMPc1
10. CME Class III Milk Electronic Commodity Future Continuation 1, Commodity Future, Chicago Mercantile Exchange
        RIC: 1DCSc1

Hit any key to continue...
10/28/2020 10:00:57 AM:Session is Closed. (State: Closed)

I change the Logger level of the Library to Trace, and This is a JSON message from the request that API sends to the server.

2020-10-28 09:55:55.9517|Debug|Refinitiv.DataPlatform.Delivery.Request.EndpointCore|5|Preparing Endpoint POST request https://api.refinitiv.com/discovery/search/v1/ with Content:
"{
  "View": "CommodityQuotes",
  "Filter": "DTSubjectName eq 'milk'"
}"

The result from the app also matches with the response from the service.

2020-10-28 09:55:56.9051|Trace|Refinitiv.DataPlatform.Delivery.Request.EndpointCore|9|Endpoint response.
"IsSuccess: True
Status: {
  "HTTPStatusCode": 200,
  "HTTPReason": "OK"
}
Data: {
  "Total": 109347,
  "Hits": [
    {
      "BusinessEntity": "QUOTExCOMMODITY",
      "DocumentTitle": "CME Class 3 Milk Pit Commodity Option Chain Contracts, Commodity Future Option, CME:Index and Options Market",
      "PermID": "21482356305",
      "PI": "56415123",
      "RIC": "0#2DCS+"
    },
    {
      "BusinessEntity": "QUOTExCOMMODITY",
      "DocumentTitle": "CME Class III Mid-Sized Milk Pit Commodity Option Chain Contracts, Commodity Future Option, CME:Index and Options Market",
      "PermID": "21482021538",
      "PI": "23753003",
      "RIC": "0#2JQ+"
    },
    {
      "BusinessEntity": "QUOTExCOMMODITY",
      "DocumentTitle": "Farmgate Milk Price United Kingdom Chain, Commodity Spot, UK DEPT FOR ENVIRONMENT FOOD & RURAL AFFAIRS",
      "PermID": "21728961774",
      "PI": "408346233",
      "RIC": "0#DEFRA-UKFGM"
    },
    {
      "BusinessEntity": "QUOTExCOMMODITY",
      "DocumentTitle": "China Customs Milk Powder Imports, Energy Statistic, General Administration of Customs of China",
      "PermID": "21667818012",
      "PI": "332122192",
      "RIC": "CNC-MLKPWD-IMP"
    },
    {
      "BusinessEntity": "QUOTExCOMMODITY",
      "DocumentTitle": "CME Class III Mid-Sized Milk Pit Commodity Continuation Option Chain Contracts, Commodity Cash Option, CME:Index and Options Market",
      "PermID": "21482017597",
      "PI": "21703754",
      "RIC": "0#2JQ++"
    },
    {
      "BusinessEntity": "QUOTExCOMMODITY",
      "DocumentTitle": "CME Class 3 Milk Pit Commodity Continuation Option Chain Contracts, Commodity Cash Option, CME:Index and Options Market",
      "PermID": "21482356304",
      "PI": "56415121",
      "RIC": "0#2DCS++"
    },
    {
      "BusinessEntity": "QUOTExCOMMODITY",
      "DocumentTitle": "CME Class III Mid-Sized Milk Pit ATM Commodity Option Chain Contract, Commodity Cash Option, CME:Index and Options Market",
      "PermID": "21482702919",
      "PI": "71392524",
      "RIC": "0#2JQ+++"
    },
    {
      "BusinessEntity": "QUOTExCOMMODITY",
      "DocumentTitle": "CME Class 3 Milk Pit ATM Commodity Option Chain Contract, Commodity Cash Option, CME:Index and Options Market",
      "PermID": "21482703553",
      "PI": "71393821",
      "RIC": "0#2DCS+++"
    },
    {
      "BusinessEntity": "QUOTExCOMMODITY",
      "DocumentTitle": "New zealand Derivative Exchange Whole Milk Powder Commodity Future Continuation 1, Commodity Future, New Zealand Stock Exchange",
      "PermID": "21481161287",
      "PI": "76364058",
      "RIC": "NWMPc1"
    },
    {
      "BusinessEntity": "QUOTExCOMMODITY",
      "DocumentTitle": "CME Class III Milk Electronic Commodity Future Continuation 1, Commodity Future, Chicago Mercantile Exchange",
      "PermID": "21481015413",
      "PI": "26388514",
      "RIC": "1DCSc1"
    }
  ]
}

I believe that it's not the problem with API. It just passes the response from the service to the app.

Note that you can add the below codes at the begging of the app to change the Logger level. So you can compare the actual data API receive with the data on the application layer.


Log.Level = NLog.LogLevel.Trace;


icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvotes
6 3 6 7

Yes, I use the 2.6.01-Search-SearchService.

In order to reproduce the result you would have to add a select clause and 10 results may not be enough (although it was the 4th entry when I just tried it) most result values will look as I would expect them.

var request = Search.Definition(Search.View.CommodityQuotes)
.Filter("DTSubjectName eq 'milk'")
.Select("RIC, AssetCategoryName")
.Top(999);
DisplayResponse($"", request, "RIC", "AssetCategoryName");

Checking the trace output it seems the data is delivered this way, so I will assume it is miss-categorized server side.

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Hi @martin.grunwald

I did check that with commodity content team and they have confirmed that the classification is correct. Their answer: "We have cross contents for the China Stats Import and Export Data. Due to the nature and type of different products which has Grains, Oils, Power etc, we chose a generic classification code which best fits the entire content set."