I’ve got an ACS setup with SharePoint as the datasource. It’s working well.
When I query the index and retrieve a document, I want to take that documents ID and query the sharepoint API to get additional information about that document. However, it seems that non of the identifiable information returned with the document (as documented here):
Identifier | Type | Description |
---|---|---|
metadata_spo_site_library_item_id | Edm.String | The combination key of site ID, library ID, and item ID which uniquely identifies an item in a document library for a site. |
metadata_spo_site_id | Edm.String | The ID of the SharePoint site. |
metadata_spo_library_id | Edm.String | The ID of document library. |
metadata_spo_item_id | Edm.String | The ID of the (document) item in the library. |
etc… | … |
is recognised by the the sharepoint api e.g.
_api/web/lists/GetByTitle('XXXXXXXX')/items?$select=Id&$filter=Id eq '{metadata_spo_site_library_item_id}'
does not work, nor does any variation I have tried.
What am I doing wrong?
EDIT:
I am decoding the document key and keeping on the index each item it contains separately:
None of these provided ids identify the document in the sharepoint-api, unless I am using the wrong endpoint
2
Answers
According to my research and testing, you can use the following REST API to get the SharePoint document:
More information for reference: Working with lists and list items with REST
————————-Update—————————
The "
item_id
" is theID column
in SharePoint list/library. For example:You can display the
ID column
in Lists setting ->> Edit View.You also can get
item_id
through the following REST API:Hope it can help you.
By default, Azure cognitive search index key field will be encoded. So, the value will not be in readable format in search results. In this scenario, you need to add one more filed in index and map the key value to newly created filed without mapping function.
As I have some restrictions on my access, I could not index share point data here. Instead of that I have taken a blob storage and indexed the data.
The steps I followed are,