Skip to content

#1603 Deprecating the directory method that receives a depth value #1610

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ public void load() throws IOException, SQLException {

public void transform() throws IOException, SQLException {
// search for all records in the /employees/ directory
StructuredQueryDefinition query = new StructuredQueryBuilder().directory(1, "/employees/");
StructuredQueryDefinition query = new StructuredQueryBuilder().directory(false, "/employees/");

// the QueryBatcher efficiently paginates through matching batches from all
// appropriate nodes in the cluster then applies the transform on each batch
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public static void main(String[] args) throws ParseException, IOException {

public void run() throws ParseException, IOException {
setup();
StructuredQueryDefinition query = new StructuredQueryBuilder().directory(1, "/employees/");
StructuredQueryDefinition query = new StructuredQueryBuilder().directory(false, "/employees/");
QueryBatcher qb = moveMgr.newQueryBatcher(query)
.onUrisReady(
// This object will be closed by the QueryBatcher when stopJob is
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,11 @@ public StructuredQueryDefinition directory(boolean isInfinite, String... uris) {
* A value of 1 means to exclude subdirectories.
* @param uris the identifiers for the criteria directories
* @return the StructuredQueryDefinition for the directory query
* @deprecated since 4.6.1; a directory query in MarkLogic does not support custom depths; it is either limited
* to the given directory or it is "infinite". For that reason, prefer the {@code directory} method that accepts a
* boolean indicating whether the directory query is infinite.
*/
@Deprecated
public StructuredQueryDefinition directory(int depth, String... uris) {
return new DirectoryQuery(depth, uris);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ public void testC_BulkSearch() {
SearchHandle searchHandle = new SearchHandle();
int pageLength = 100;
docMgr.setPageLength(pageLength);
DocumentPage page = docMgr.search(new StructuredQueryBuilder().directory(1, DIRECTORY), 1, searchHandle);
DocumentPage page = docMgr.search(new StructuredQueryBuilder().directory(false, DIRECTORY), 1, searchHandle);
try {
for ( DocumentRecord record : page ) {
validateRecord(record);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public static void main(String[] args) throws Exception {
}

System.out.println(client.newQueryManager().search(
client.newQueryManager().newStructuredQueryBuilder().directory(0, "/")
client.newQueryManager().newStructuredQueryBuilder().directory(true, "/")
, new JacksonHandle()).get().toPrettyString());

System.out.println("Successfully finished cloud-based authentication test");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public void invalidQuery() {

FailedRequestException ex = assertThrows(FailedRequestException.class, () ->
client.newDataMovementManager().newQueryBatcher(
client.newQueryManager().newStructuredQueryBuilder().directory(0, "/invalid/path")
client.newQueryManager().newStructuredQueryBuilder().directory(false, "/invalid/path")
).onQueryFailure(failure -> failureMessages.add(failure.getMessage()))
);

Expand Down