question

Upvotes
Accepted
50 1 4 4

How can I limit my search to a particular entity type?

Using the DF API, I have found what seems to be a bug in the API.

If I use /entity/search/, and use ‘Agricultural Bank of China H share’, I get a long list of results, almost all of which have

“type”: “document”

In the result.

If I change the request to use:

‘entityTypeId’: ‘1443817804036_instrument’

I would expect to exclude all results that are documents. However, it doesn’t seem to make any difference to the results.

The request URL is:

https://{instance}/datafusion/api/entity/search?searchString=Agricultural%20Bank%20of%20China%20H%20share&entityTypeId=1443817804036_instrument&includePredicates=false&includeRelDir=false&filterType=and&includeHiddenFields=false

The request URL generated by the Data Fusion API webpage seems correct, but doesn’t seem to have any impact.

apidata-fusion
icon clock
10 |1500

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

1 Answer

Upvote
Accepted
36 0 2 1

Hi @peter.vonbredow,

`entityTypeId` expects a long value that is the id of the entity type.

`1443817804036_instrument` is the shortname for `Instrument` entity type that has id of 28 on this particular instance [from https://{instance}/datafusion/api#!/entity/getEntityTypes]. Please try the id value for entityTypeId parameter for Instrument entity type, the request URL would be:

https://{instance}/datafusion/api/entity/search?searchString=Agricultural%20Bank%20of%20China%20H%20share&entityTypeId=28&includePredicates=false&includeRelDir=false&filterType=and&includeHiddenFields=false

It seems there is no Instrument that matches the search string 'Agricultural Bank of China H share'

Hope this helps.

Thanks,
Nguyen Nguyen

icon clock
10 |1500

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

Click below to post an Idea Post Idea