Uploaded image for project: 'Jackrabbit Content Repository'
  1. Jackrabbit Content Repository
  2. JCR-2668

spi2dav: rep:excerpt() does not work

    XMLWordPrintableJSON

Details

    Description

      When using Jackrabbit JCR via DavEx (not RMI) and doing an fulltext-search xpath query including excerpt of the found text parts.

      I am using the following code to test a fulltext search query for term "jackrabbit":

      ----------------------------------------- test function start ------------------------------------
      public void doFulltextSearchTest() {
      try {
      System.out.println("found:");
      RowIterator rows = queryFulltextSearch("kanzlei");
      for (RowIterator it = rows; it.hasNext()

      { Row r = it.nextRow(); Value title = r.getValue("Title"); Value excerpt = r.getValue("rep:excerpt(.)"); System.out.println("Element title:" + title + " excerpt" + excerpt); }

      } catch (ItemNotFoundException e)

      { e.printStackTrace(); } catch (RepositoryException e) { e.printStackTrace(); }

      }

      public RowIterator queryFulltextSearch(String searchstring) throws RepositoryException

      { QueryManager qm = currentSession.getWorkspace().getQueryManager(); Query q = qm.createQuery("//*[jcr:contains(., '"+searchstring+"')]/(@Title|rep:excerpt(.))", Query.XPATH); QueryResult result = q.execute(); return result.getRows(); }

      ----------------------------------------- test function end------------------------------------

      ---------------------------- causes Exception start --------------------------------------
      javax.jcr.ItemNotFoundException: rep:excerpt(.)
      at org.apache.jackrabbit.jcr2spi.query.RowIteratorImpl$RowImpl.getValue(RowIteratorImpl.java:271)
      at consearch.demos.jcr.FulltextSearchTest.<init>(FulltextSearchTest.java:44)
      at consearch.demos.jcr.FulltextSearchTest.main(FulltextSearchTest.java:61)
      ---------------------------- causes Exception end --------------------------------------

      I guess that excerpt is a major feature when getting WebDav in a full featured state

      Attachments

        Activity

          People

            Unassigned Unassigned
            malcomtom Thomas Malcom
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated: