title: Get Documents from Cosmosdb Java Cross partition query is required but disabled
body: <pre><code>public static Document getDocumentById(String id) {
  
    FeedOptions queryOptions = new FeedOptions();
       queryOptions.setMaxItemCount(10);
       queryOptions.setEnableCrossPartitionQuery(true);
  
    // Retrieve the document using the DocumentClient.
    List&lt;Document&gt; documentList = documentClient
          .queryDocuments(getTodoCollection().getSelfLink(),
                "SELECT * FROM c WHERE c.id='" + id + "'",null,queryOptions)
          .getQueryIterable().toList();
  
    if (documentList.size() &gt; 0) {
       return documentList.get(0);
    } else {
       return null;
    }
  </code></pre>
  
  <p>Hello, I am trying to get some help with retrieving a document from Cosmosdb using Java using the code above.
  I am getting the following error:</p>
  
  <blockquote>
    <p>WARNING: Operation will NOT be retried. Exception: Cross partition
    query is required but disabled. Please set
    x-ms-documentdb-query-enablecrosspartition to true, specify
    x-ms-documentdb-partitionkey, or revise your query to avoid this
    exception. ActivityId: 09c62e77-f9dc-4cc7-902d-0cd8c5cad8a6,
    Microsoft.Azure.Documents.Common/2.2.0.0</p>
  </blockquote>
  
  <p>Any help you can provide me would be appreciated!
  Thanks</p>