This is an automated email from the ASF dual-hosted git repository.

rnewson pushed a commit to branch nouveau-dep-updates
in repository https://gitbox.apache.org/repos/asf/couchdb.git

commit c6d430147bbda512f18a43415ec9919287e23dc2
Author: Robert Newson <[email protected]>
AuthorDate: Tue Nov 10 12:12:18 2026 +0000

    move name/path/docid to query params
---
 .../couchdb/nouveau/resources/IndexResource.java   | 44 ++++------------------
 src/nouveau/src/nouveau_api.erl                    | 12 +++---
 2 files changed, 14 insertions(+), 42 deletions(-)

diff --git 
a/extra/nouveau/src/main/java/org/apache/couchdb/nouveau/resources/IndexResource.java
 
b/extra/nouveau/src/main/java/org/apache/couchdb/nouveau/resources/IndexResource.java
index 182152a5d..bd9d038af 100644
--- 
a/extra/nouveau/src/main/java/org/apache/couchdb/nouveau/resources/IndexResource.java
+++ 
b/extra/nouveau/src/main/java/org/apache/couchdb/nouveau/resources/IndexResource.java
@@ -24,8 +24,8 @@ import jakarta.ws.rs.GET;
 import jakarta.ws.rs.POST;
 import jakarta.ws.rs.PUT;
 import jakarta.ws.rs.Path;
-import jakarta.ws.rs.PathParam;
 import jakarta.ws.rs.Produces;
+import jakarta.ws.rs.QueryParam;
 import jakarta.ws.rs.WebApplicationException;
 import jakarta.ws.rs.core.MediaType;
 import jakarta.ws.rs.core.Response.Status;
@@ -43,7 +43,7 @@ import org.apache.couchdb.nouveau.api.SearchRequest;
 import org.apache.couchdb.nouveau.api.SearchResults;
 import org.apache.couchdb.nouveau.core.IndexManager;
 
-@Path("/index/{name}")
+@Path("/index")
 @Metered
 @ResponseMetered
 @ExceptionMetered(cause = IOException.class)
@@ -58,7 +58,7 @@ public final class IndexResource {
     }
 
     @PUT
-    public Ok createIndex(@PathParam("name") String name, @NotNull @Valid 
IndexDefinition indexDefinition)
+    public Ok createIndex(@QueryParam("name") String name, @NotNull @Valid 
IndexDefinition indexDefinition)
             throws IOException {
         if (!indexDefinition.isLatestVersion()) {
             throw new WebApplicationException(
@@ -69,35 +69,21 @@ public final class IndexResource {
         return Ok.INSTANCE;
     }
 
-    @Deprecated(since = "3.5.2", forRemoval = true)
     @DELETE
-    @Path("/doc/{docId}")
-    public Ok deleteDoc(
-            @PathParam("name") String name,
-            @PathParam("docId") String docId,
-            @NotNull @Valid DocumentDeleteRequest request)
-            throws Exception {
-        return indexManager.with(name, (index) -> {
-            index.delete(docId, request);
-            return Ok.INSTANCE;
-        });
-    }
-
-    @DELETE
-    public Ok deletePath(@PathParam("name") String path, @Valid final 
List<String> exclusions) throws IOException {
+    public Ok deletePath(@QueryParam("name") String path, @Valid final 
List<String> exclusions) throws IOException {
         indexManager.deleteAll(path, exclusions);
         return Ok.INSTANCE;
     }
 
     @GET
-    public IndexInfoResponse getIndexInfo(@PathParam("name") String name) 
throws Exception {
+    public IndexInfoResponse getIndexInfo(@QueryParam("name") String name) 
throws Exception {
         return indexManager.with(name, (index) -> {
             return index.info();
         });
     }
 
     @POST
-    public Ok setIndexInfo(@PathParam("name") String name, @NotNull @Valid 
IndexInfoRequest request) throws Exception {
+    public Ok setIndexInfo(@QueryParam("name") String name, @NotNull @Valid 
IndexInfoRequest request) throws Exception {
         return indexManager.with(name, (index) -> {
             var shouldCommit = false;
             if (request.matchUpdateSeq().isPresent() && 
request.updateSeq().isPresent()) {
@@ -120,30 +106,16 @@ public final class IndexResource {
 
     @POST
     @Path("/search")
-    public SearchResults searchIndex(@PathParam("name") String name, @NotNull 
@Valid SearchRequest request)
+    public SearchResults searchIndex(@QueryParam("name") String name, @NotNull 
@Valid SearchRequest request)
             throws Exception {
         return indexManager.with(name, (index) -> {
             return index.search(request);
         });
     }
 
-    @Deprecated(since = "3.5.2", forRemoval = true)
-    @PUT
-    @Path("/doc/{docId}")
-    public Ok updateDoc(
-            @PathParam("name") String name,
-            @PathParam("docId") String docId,
-            @NotNull @Valid DocumentUpdateRequest request)
-            throws Exception {
-        return indexManager.with(name, (index) -> {
-            index.update(docId, request);
-            return Ok.INSTANCE;
-        });
-    }
-
     @POST
     @Path("/update")
-    public Ok update(@PathParam("name") String name, @NotNull @Valid 
BulkUpdateRequest request) throws Exception {
+    public Ok update(@QueryParam("name") String name, @NotNull @Valid 
BulkUpdateRequest request) throws Exception {
         return indexManager.with(name, (index) -> {
             for (var update : request.updates()) {
                 if (update.update() instanceof DocumentUpdateRequest) {
diff --git a/src/nouveau/src/nouveau_api.erl b/src/nouveau/src/nouveau_api.erl
index 2e8b1c37d..106ca89a4 100644
--- a/src/nouveau/src/nouveau_api.erl
+++ b/src/nouveau/src/nouveau_api.erl
@@ -317,23 +317,23 @@ supported_lucene_versions() ->
 %% private functions
 
 index_path(Path) when is_binary(Path) ->
-    [<<"/index/">>, couch_util:url_encode(Path)];
+    [<<"/index?name=">>, couch_util:url_encode(Path)];
 index_path(#index{} = Index) ->
-    [<<"/index/">>, couch_util:url_encode(nouveau_util:index_name(Index))].
+    [<<"/index?name=">>, 
couch_util:url_encode(nouveau_util:index_name(Index))].
 
 doc_path(#index{} = Index, DocId) ->
     [
-        <<"/index/">>,
+        <<"/index?name=">>,
         couch_util:url_encode(nouveau_util:index_name(Index)),
-        <<"/doc/">>,
+        <<"&doc_id=">>,
         couch_util:url_encode(DocId)
     ].
 
 search_path(#index{} = Index) ->
-    [index_path(Index), <<"/search">>].
+    [<<"/index/search?name=">>, 
couch_util:url_encode(nouveau_util:index_name(Index))].
 
 update_path(#index{} = Index) ->
-    [index_path(Index), <<"/update">>].
+    [<<"/index/update?name=">>, 
couch_util:url_encode(nouveau_util:index_name(Index))].
 
 jaxrs_error(400, Body) ->
     {bad_request, message(Body)};

Reply via email to