+
+ /**
+ * Checks the supplied HTTP headers to see if we should allow the underlying document
+ * store to implicitly create the index referenced in a document PUT or POST if it
+ * does not already exist in the data store.
+ *
+ * @param headers - The HTTP headers to examine.
+ *
+ * @return - true if the headers indicate that missing indices should be implicitly created,
+ * false otherwise.
+ */
+ private boolean implicitlyCreateIndex(HttpHeaders headers) {
+
+ boolean createIndexIfNotPresent = false;
+ String implicitIndexCreationHeader =
+ headers.getRequestHeaders().getFirst(REQUEST_HEADER_ALLOW_IMPLICIT_INDEX_CREATION);
+
+ if( (implicitIndexCreationHeader != null) && (implicitIndexCreationHeader.equals("true")) ) {
+ createIndexIfNotPresent = true;
+ }
+
+ return createIndexIfNotPresent;
+ }
+
+