Alexandre Castro
Alexandre Castro

Reputation: 99

Indexing Sharepoint Online Site in Azure search

I'm trying to index a Sharepoint Website document library and i followed this tutorial.

https://learn.microsoft.com/en-us/azure/search/search-howto-index-sharepoint-online

Everything is working fine i have my skillset triggered and standard Sharepoint columns are retrieved.

My main issue is that i want to retrieve custom columns created in this library.

For exemple i have a colum displayed as "Document usage" , the technical name is "DocumentUsage" and as i saw in the documentation , to get custom fields, you need to specify it in the connection string of datasource created in Azure Search like below :

"container": { "name": "useQuery", "query": "includeLibrariesInSite=https://myorganisation.sharepoint.com/sites/mysite;additionalColumns:DocumentUsage,UploadableDocument,DocumentFormat,Langage,TargetForUse,PaidContent,PublicationDate,Activity,TargetApplication,ProductCategory,SerialNumber,KeyWords"

And i made a mapping of the fields in my indexer like below :

"fieldMappings": [
    {
      "sourceFieldName": "metadata_spo_site_library_item_id",
      "targetFieldName": "id",
      "mappingFunction": {
        "name": "base64Encode",
        "parameters": null
      }
    },
    {
      "sourceFieldName": "content",
      "targetFieldName": "content",
      "mappingFunction": null
    },
    {
      "sourceFieldName": "DocumentUsage",
      "targetFieldName": "document_usage",
      "mappingFunction": null
    },
    {
      "sourceFieldName": "UploadableDocument",
      "targetFieldName": "uploadable_document",
      "mappingFunction": null
    },
    {
      "sourceFieldName": "DocumentFormat",
      "targetFieldName": "document_format",
      "mappingFunction": null
    },
    {
      "sourceFieldName": "Langage",
      "targetFieldName": "language_sp",
      "mappingFunction": null
    },
    {
      "sourceFieldName": "TargetForUse",
      "targetFieldName": "target_for_use",
      "mappingFunction": null
    },
    {
      "sourceFieldName": "PaidContent",
      "targetFieldName": "paid_content",
      "mappingFunction": null
    },
    {
      "sourceFieldName": "PublicationDate",
      "targetFieldName": "publication_date",
      "mappingFunction": null
    },
    {
      "sourceFieldName": "Activity",
      "targetFieldName": "activity",
      "mappingFunction": null
    },
    {
      "sourceFieldName": "TargetApplication",
      "targetFieldName": "target_application",
      "mappingFunction": null
    },
    {
      "sourceFieldName": "ProductCategory",
      "targetFieldName": "product_category",
      "mappingFunction": null
    },
    {
      "sourceFieldName": "SerialNumber",
      "targetFieldName": "serial_number",
      "mappingFunction": null
    },
    {
      "sourceFieldName": "KeyWords",
      "targetFieldName": "key_words",
      "mappingFunction": null
    }
  ],

Everything is working fine except for my additional sharepoint custom columns. My issue is that standard fields are retrieved but not the custom ones specified in the datasource query.

Do i have to put the technical names or the display names of the columns?

Is there a trick to retrieve special columns ? As you can see , standard ones are retrieved but not the custom one which are filled in the document library.

enter image description here

Thanks in advance for help.

Regards

Upvotes: 0

Views: 805

Answers (1)

Gia Mondragon - MSFT
Gia Mondragon - MSFT

Reputation: 466

There is a typo in your data source 'container' => 'query' field value. You have a colon after 'additionalColumns' (additionalColumns:DocumentUsage) and equal (=) must be instead.

Try with replacing additionalColumns:DocumentUsage with additionalColumns=DocumentUsage

Upvotes: 2

Related Questions