Shinsuke Sugaya před 2 roky
rodič
revize
0a69c29545

+ 8 - 6
src/main/config/openapi/openapi-user.yaml

@@ -1,6 +1,6 @@
 openapi: 3.0.3
 openapi: 3.0.3
 info:
 info:
-  title: Fess - OpenAPI 3.0
+  title: Fess - User API
   description: |-
   description: |-
     This is a Fess Server based on the OpenAPI 3.0 specification.  
     This is a Fess Server based on the OpenAPI 3.0 specification.  
   license:
   license:
@@ -8,7 +8,7 @@ info:
     url: http://www.apache.org/licenses/LICENSE-2.0.html
     url: http://www.apache.org/licenses/LICENSE-2.0.html
   version: 14.8.0
   version: 14.8.0
 externalDocs:
 externalDocs:
-  description: API Documentation for Fess
+  description: API Documentation
   url: https://fess.codelibs.org/14.8/api/
   url: https://fess.codelibs.org/14.8/api/
 servers:
 servers:
   - url: http://localhost:8080/api/v1
   - url: http://localhost:8080/api/v1
@@ -21,6 +21,8 @@ tags:
     description: Monitoring operations
     description: Monitoring operations
   - name: suggest
   - name: suggest
     description: Suggest operations
     description: Suggest operations
+  - name: favorite
+    description: Favorite operations
 paths:
 paths:
   /documents:
   /documents:
     get:
     get:
@@ -597,14 +599,14 @@ paths:
               schema:
               schema:
                 type: object
                 type: object
                 properties:
                 properties:
-                  took:
+                  query_time:
                     type: integer
                     type: integer
                     format: int64
                     format: int64
                     example: 18
                     example: 18
-                  total:
+                  record_count:
                     type: integer
                     type: integer
                     example: 355
                     example: 355
-                  num:
+                  page_size:
                     type: integer
                     type: integer
                     example: 10
                     example: 10
                   data:
                   data:
@@ -615,7 +617,7 @@ paths:
                         text:
                         text:
                           type: string
                           type: string
                           example: fess
                           example: fess
-                        field:
+                        labels:
                           type: array
                           type: array
                           items:
                           items:
                             type: string
                             type: string

+ 2 - 2
src/main/webapp/js/advance.js

@@ -13,8 +13,8 @@ $(function() {
   if (typeof $.fn.suggestor === "function") {
   if (typeof $.fn.suggestor === "function") {
     $("#as_q").suggestor({
     $("#as_q").suggestor({
       ajaxinfo: {
       ajaxinfo: {
-        url: contextPath + "/suggest",
-        fn: "_default,content,title",
+        url: contextPath + "/api/v1/suggest-words",
+        fn: ["_default", "content", "title"],
         num: 10,
         num: 10,
         lang: $("#langSearchOption").val()
         lang: $("#langSearchOption").val()
       },
       },

+ 2 - 2
src/main/webapp/js/help.js

@@ -35,8 +35,8 @@ $(function() {
   if (typeof $.fn.suggestor === "function") {
   if (typeof $.fn.suggestor === "function") {
     $("#query").suggestor({
     $("#query").suggestor({
       ajaxinfo: {
       ajaxinfo: {
-        url: contextPath + "/suggest",
-        fn: "_default,content,title",
+        url: contextPath + "/api/v1/suggest-words",
+        fn: ["_default", "content", "title"],
         num: 10,
         num: 10,
         lang: $("#langSearchOption").val()
         lang: $("#langSearchOption").val()
       },
       },

+ 2 - 2
src/main/webapp/js/index.js

@@ -37,8 +37,8 @@ $(function() {
   if (typeof $.fn.suggestor === "function") {
   if (typeof $.fn.suggestor === "function") {
     $("#contentQuery").suggestor({
     $("#contentQuery").suggestor({
       ajaxinfo: {
       ajaxinfo: {
-        url: contextPath + "/suggest",
-        fn: "_default,content,title",
+        url: contextPath + "/api/v1/suggest-words",
+        fn: ["_default", "content", "title"],
         num: 10,
         num: 10,
         lang: $("#langSearchOption").val()
         lang: $("#langSearchOption").val()
       },
       },

+ 2 - 2
src/main/webapp/js/search.js

@@ -189,8 +189,8 @@ $(function() {
   if (typeof $.fn.suggestor === "function") {
   if (typeof $.fn.suggestor === "function") {
     $("#query").suggestor({
     $("#query").suggestor({
       ajaxinfo: {
       ajaxinfo: {
-        url: contextPath + "/suggest",
-        fn: "_default,content,title",
+        url: contextPath + "/api/v1/suggest-words",
+        fn: ["_default", "content", "title"],
         num: 10,
         num: 10,
         lang: $("#langSearchOption").val()
         lang: $("#langSearchOption").val()
       },
       },

+ 4 - 4
src/main/webapp/js/suggestor.js

@@ -109,8 +109,8 @@
               dataType: "json",
               dataType: "json",
               cache: false,
               cache: false,
               data: {
               data: {
-                query: $textArea.val(),
-                fields: settingAjaxInfo.fn,
+                q: $textArea.val(),
+                field: settingAjaxInfo.fn,
                 num: settingAjaxInfo.num * 2,
                 num: settingAjaxInfo.num * 2,
                 lang: settingAjaxInfo.lang
                 lang: settingAjaxInfo.lang
               },
               },
@@ -126,12 +126,12 @@
           },
           },
 
 
           createAutoCompleteList: function(obj) {
           createAutoCompleteList: function(obj) {
-            if (obj.response.status !== 0) {
+            if (typeof obj.record_count === "undefined") {
               $boxElement.css("display", "none");
               $boxElement.css("display", "none");
               return;
               return;
             }
             }
 
 
-            var hits = obj.response.result.hits,
+            var hits = obj.data,
                 suggestor = this,
                 suggestor = this,
                 reslist,
                 reslist,
                 $olEle,
                 $olEle,