You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by "Jukka Zitting (JIRA)" <ji...@apache.org> on 2010/08/04 16:17:17 UTC

[jira] Updated: (JCR-2668) spi2dav: rep:excerpt() does not work

     [ https://issues.apache.org/jira/browse/JCR-2668?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jukka Zitting updated JCR-2668:
-------------------------------

    Fix Version/s:     (was: 2.1.1)

> spi2dav: rep:excerpt() does not work
> ------------------------------------
>
>                 Key: JCR-2668
>                 URL: https://issues.apache.org/jira/browse/JCR-2668
>             Project: Jackrabbit Content Repository
>          Issue Type: Bug
>          Components: jackrabbit-jcr-server, jackrabbit-spi2dav, JCR 2.0, query
>    Affects Versions: 2.1.0
>         Environment: JCR via DavEx
>            Reporter: Thomas Malcom
>
> 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

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.