Hi, On Thu, May 1, 2014 at 2:24 PM, eftal sogukoglu <[email protected]> wrote: > ...Why is the usage not recommended at all?...
The discussion is at http://markmail.org/message/sxurvywelnyt3ntz - there's nothing terribly wrong with it but the servlet ignores the current request's resource, which can be a bit confusing and does not follow our current best practices. > ...what would be your > recommended way of doing restful searches?... If you look at the JsonQueryServlet code [1] it's very simple, and having lots of content is really a problem of the underlying content repository, so using it might not be too bad. The "resource is ignored" bit could be improved by mounting the servlet on a specific resource type, instead of using sling/servlet/default which means it currently applies to any resource if you use the .query.json path suffix - that's what's not really conform to the Sling way of thinking. Modifying the servlet (or creating a descendant class) so that it's mounted on a sling/query resource type for example would be better, and there's probably other things that can be improved...we vaguely discussed that when moving it to the compat bundle, but no one has come up with an improved variant so far. In summary, starting with that servlet is probably fine, and if you improve it based on your use cases contributions are welcome - we might create a new query bundle with an improved variant. I'll reply to your use case questions separately. -Bertrand [1] https://svn.apache.org/repos/asf/sling/trunk/bundles/servlets/compat/src/main/java/org/apache/sling/servlets/compat/impl/JsonQueryServlet.java
