code: public static void configureQueryOptions(DatabaseClient client)
      throws FailedRequestException, ForbiddenUserException, ResourceNotFoundException, ResourceNotResendableException
    {
      // create a manager for writing query options
      QueryOptionsManager optionsMgr = client.newServerConfigManager().newQueryOptionsManager();
  
      // create the query options
      String options =
        "<search:options "+
          "xmlns:search='http://marklogic.com/appservices/search'>"+
          "<search:constraint name='industry'>"+
          "<search:value>"+
          "<search:element name='industry' ns=''/>"+
          "</search:value>"+
          "</search:constraint>"+
          "<search:return-aggregates>false</search:return-aggregates>"+
          "<search:return-constraints>false</search:return-constraints>"+
          "<search:return-facets>false</search:return-facets>"+
          "<search:return-frequencies>false</search:return-frequencies>"+
          "<search:return-metrics>false</search:return-metrics>"+
          "<search:return-plan>false</search:return-plan>"+
          "<search:return-qtext>false</search:return-qtext>"+
          "<search:return-query>false</search:return-query>"+
          "<search:return-similar>true</search:return-similar>"+
          "<search:return-values>false</search:return-values>"+
          "<search:return-results>false</search:return-results>"+
          "<search:transform-results apply='empty-snippet'/>"+
          "</search:options>";
  
      // create a handle to send the query options
      StringHandle writeHandle = new StringHandle(options);
  
      // write the query options to the database
      optionsMgr.writeOptions(OPTIONS_NAME, writeHandle);
  
      System.out.println("Configured the query options on the server");
    }
docs: set up the query options for the collecting search