Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p><em>Background:</em> the Java API is a layer on the REST API is a layer on the Search API is a layer on cts:search</p> <p>You can express this query in the Search API. </p> <ul> <li><p>Use a searchable expression for the first parameter in your query options <a href="http://docs.marklogic.com/guide/search-dev/search-api#id_43671" rel="nofollow">http://docs.marklogic.com/guide/search-dev/search-api#id_43671</a></p></li> <li><p>Use an empty and query for the structured query <a href="http://docs.marklogic.com/guide/search-dev/structured-query#id_83674" rel="nofollow">http://docs.marklogic.com/guide/search-dev/structured-query#id_83674</a></p></li> </ul> <p>Using the Java API, you can search using the query options and structured query as a RawCombinedQueryDefinition.</p> <p>All that said, you could just also search for an element-query on bfa:AppUser containing a value constraint query on bfa:appAccess/@appRole of "ROLE_SYS_ADMIN"</p> <p>While XPath can be convenient, it's a good idea to become conversant in query expressions to understand the full power and flexibility of the database.</p> <p><strong>Update 1:</strong></p> <p>A few things to consider:</p> <ul> <li><p>A query in the Search API has two parts: the query (expressed either with Google-style string search or with JSON or XML structured search) and the query options. The StructuredQueryBuilder builds structured search. The QueryOptionsBuilder only built the query options.</p></li> <li><p>In ML 6.0-3, the REST API introduced support for combined search, which provides both parts in a single request. The Java API added support for such requests through the RawCombinedQueryDefinition class. </p></li> <li><p>ML7 is expanding structured search to reduce or eliminate the need for query options with structured search. StructuredQueryBuilder is enhanced in ML7 to support the new features of structured search. In ML7, you'll be able to write your example query above entirely in StructuredQueryBuilder without any need for query options.</p></li> <li><p>When we compared the code constructing query options with QueryOptionsBuilder and with JDOM or XOM, it was hard to see much LOC benefit in the builder.</p></li> <li><p>You don't have to hardcode query options in a string. For separation of concerns, you can read JSON or XML query options from a file or from many other sources. (Please see the implementations of the <a href="http://docs.marklogic.com/javadoc/client/com/marklogic/client/io/marker/QueryOptionsReadHandle.html" rel="nofollow">http://docs.marklogic.com/javadoc/client/com/marklogic/client/io/marker/QueryOptionsReadHandle.html</a> marker interface.)</p></li> <li><p>Query options provide a declaration instead of executable code. The parallel would be with Spring configuration files rather than with SPL files.</p></li> </ul> <p>BTW, while JAXB is great for designs sourced in Java classes, JAXB can be quite painful for designs sourced in a complex XML schema. The search schema takes advantage of the powerful capabilities of XML schemas. When we explored this route, we concluded that JAXB was not not going to help provide an interface to query options.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload