Sling
  1. Sling
  2. SLING-573

google-style shorthand on query.json

    Details

    • Type: Improvement Improvement
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Servlets
    • Labels:
      None

      Description

      it would be great to allow a "q=" parameter similar to google that would allow for simple and easy
      querying of the repository in google style.

      this would be an additional feature that would auto detect the querytype based on the query.
      it is neither a "sql", "xpath" or google syntax jcr:contains query...

      examples:

      /mynode.query.json?q=SELECT%20*%20FROM%20nt%3abase
      ... translates into ...
      SELECT * FORM nt:base WHERE jcr:path like '/mynode/%'

      /mynode.query.json?q=mytest
      ... translates into ...
      SELECT * FORM nt:base WHERE jcr:path like '/mynode/%' and jcr:contains(*, 'mytest')


      or xpath equivalent...

        Issue Links

          Activity

          Hide
          Marcel Reutegger added a comment -

          I've just committed such a simple query language to jackrabbit-jcr-commons. See JCR-1697. The class will be available with the Jackrabbit 1.5 release.

          Show
          Marcel Reutegger added a comment - I've just committed such a simple query language to jackrabbit-jcr-commons. See JCR-1697 . The class will be available with the Jackrabbit 1.5 release.
          Hide
          Felix Meschberger added a comment -

          Add dependency on JCR-1697 adding the Google syntax support

          Show
          Felix Meschberger added a comment - Add dependency on JCR-1697 adding the Google syntax support
          Hide
          Justin Edelson added a comment -

          revisiting this, I found that the GQL class added in JCR-1697 only supports the RowIterator result type, not the QueryResult type needed by the JsonQueryServlet. Submitted a patch in JCR-2988 to add support for QueryResult as a return type.

          Show
          Justin Edelson added a comment - revisiting this, I found that the GQL class added in JCR-1697 only supports the RowIterator result type, not the QueryResult type needed by the JsonQueryServlet. Submitted a patch in JCR-2988 to add support for QueryResult as a return type.
          Hide
          Ian Boston added a comment -

          Word of caution: In other projects using Sling we found that this type of query needs to be sanitised if exposed to non administrative users as it make a perfect DOS vector. Simple queries with wild cards often consume a lot of resource, although I dont have an example to hand. (If access is controlled then no problem.)

          Show
          Ian Boston added a comment - Word of caution: In other projects using Sling we found that this type of query needs to be sanitised if exposed to non administrative users as it make a perfect DOS vector. Simple queries with wild cards often consume a lot of resource, although I dont have an example to hand. (If access is controlled then no problem.)

            People

            • Assignee:
              Unassigned
              Reporter:
              David Nuescheler
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:

                Development