title: How to add Primary key of Azure Cosmos DB as search parameter in Azure search Service
body: <p>I am using Azure search service to search for the documents in my Azure CosmosDB Account.</p>
  
  <p>Using the portal, I have created an Azure search service and given my existing CosmosDB as data source.</p>
  
  <p>Following is the sample document stored in CosmosDB</p>
  
  <pre><code>{
      "id": "Engine",     
      "Sub-Components Price": [
          //Price list
      ],
      "Sub-Components": [
          "List of sub components here"
      ],      
      "Brand": "Brand Name here",     
  }
  </code></pre>
  
  <p>When the CosmosDB containing above document is given as data source to the Azure search, id field is internally converted to some string (Automatic Indexing may be).</p>
  
  <p>I am able to set other fields like Sub-Components, Brand as search parameter (using C#) and search only those specific fields. I want to apply the same to id field also. But id field encrypted/encoded to some other string as follows:</p>
  
  <pre><code>{
      "id": "UkVRX1ZFSF9DVVNUX0",     
      "Sub-Components Price": [
          //Price list
      ],
      "Sub-Components": [
          "List of sub components here"
      ],      
      "Brand": "Brand Name here",     
  }
  </code></pre>
  
  <p>How to retrieve my original id and set it as search parameter?</p>
  
  <p>Thanks in advance !!</p>