jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <wikidi...@apache.org>
Subject [Jackrabbit Wiki] Update of "frm/HttpOperations" by frm
Date Mon, 04 May 2015 11:38:34 GMT
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Jackrabbit Wiki" for change notification.

The "frm/HttpOperations" page has been changed by frm:
https://wiki.apache.org/jackrabbit/frm/HttpOperations?action=diff&rev1=10&rev2=11

  In case of success, the server returns a `200` response with a content type of `application/json`.
The body of the response is a JSON object similar to the following.
  
  {{{
-   {
+ {
-     "total": 25,
+   "total": 2,
-     "columns": [
+   "columns": [
+     "c1", 
+     "c2"
-       "first", 
-       "second", 
-       "third"
-     ],
+   ],
+   "selectors": [
+     "s1",
+     "s2"
+   ],
-     "results": [
+   "results": [
-       {"first": "...", "second": "...", "third": "..."},
-       {"first": "...", "second": "...", "third": "..."},
-       {"first": "...", "second": "...", "third": "..."},
-       {"first": "...", "second": "...", "third": "..."}
+     {
+       "columns": {"c1": "...", "c2": "..."}, 
+       "selectors": {"s1": "...", "s2": "..."}
+     },
+     {
+       "columns": {"c1": "...", "c2": "..."}, 
+       "selectors": {"s1": "...", "s2": "..."}
+     }
+   ]
+ }
+ }}}
+ 
+ The values for the `"columns"` and `"selectors"` property are entirely dependent on the
query. In example, the query `select name from nt:unstructured as node` will force the inclusion
of the column `name` and the selector `node` in the search results. Please also note that
special columns like `jcr:path` and `jcr:score` are always included in the results even if
not specified in the query.
+ 
+ Since there some column and selector names may overlap, they are presented in two different
sub-objects of each search result.
+ 
+ The value of each column in a search result is a value in the usual form:
+ 
+ {{{
+ {"type": "string", "value": "bar"}
+ }}}
+ 
+ Please note that some columns may be `null`. This happens when selecting a property name
from a node that doesn't actually have a property of that name.
+ 
+ The value of each selector is a path. More specifically, it is the path of the node identified
by the corresponding selector.
+ 
+ A more realistic example of a search result is provided below. These results are generated
by the following query 
+ 
+ {{{
+ select name, address from nt:unstructured node where jcr:path like '/test/%'  
+ }}}
+ 
+ For the query above, the returned search result (for my repository data) are:
+ 
+ {{{
+ {
+    "total":2,
+    "columns":[
+       "name",
+       "address",
+       "jcr:path",
+       "jcr:score"
+    ],
+    "selectors":[
+       "node"
+    ],
+    "results":[
+       {
+          "columns":{
+             "name":{
+                "type":"string",
+                "value":"Joe"
+             },
+             "address":{
+                "type":"string",
+                "value":"Whatever Street 42"
+             },
+             "jcr:path":{
+                "type":"string",
+                "value":"/test/two"
+             },
+             "jcr:score":null
+          },
+          "selectors":{
+             "node":"/test/two"
+          }
+       },
+       {
+          "columns":{
+             "name":{
+                "type":"string",
+                "value":"Moe"
+             },
+             "address":null,
+             "jcr:path":{
+                "type":"string",
+                "value":"/test/one"
+             },
+             "jcr:score":null
+          },
+          "selectors":{
+             "node":"/test/one"
+          }
+       }
-     ]
+    ]
-  }
+ }
  }}}
  

Mime
View raw message