jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alexandre Martins" <alexandremart...@gmail.com>
Subject Re: How can I filter a sql query by file type?
Date Mon, 05 Feb 2007 16:08:26 GMT
my query is ok now... using SQL

SELECT * FROM nt:base WHERE CONTAINS(.,'data mining')  AND (
(jcr:mimeType='app
lication/pdf')  )  order by jcr:score DESC

thanks

2007/2/5, Marcel Reutegger <marcel.reutegger@gmx.net>:
>
> Alexandre Martins wrote:
> > I need retrive nodes that contains some text and are of a specific file
> > types.
> >
> > "SELECT * FROM nt:base WHERE CONTAINS(.,'" + pTextQuery + "') AND
> jcr:path
> > LIKE '%/%.pdf/%' order by jcr:score DESC";
>
> Matching of paths in JSR 170 is limited to only a few simple use cases.
> What you
> basically can do is search in a sub-tree: jcr:path LIKE '/foo/bar/%'.
>
> If you have more complex needs you should use XPath, which allows you to
> filter
> on every path segment.
>
> > i´m using the query (below) normaly to retrieve files indexed by some
> text.
> >
> > "SELECT * FROM nt:base WHERE CONTAINS(.,'" + pTextQuery + "')  order by
> > jcr:score DESC";
>
> As of jackrabbit 1.2.1 you can use the following query:
>
> //element(*, nt:file)[jcr:contains(jcr:content, 'your query') and
> jcr:content/@jcr:mimeType = 'application/pdf']
>
> regards
>   marcel
>



-- 
Alexandre Costa Martins
CESAR - Recife Center for Advanced Studies and Systems
Software Engineer and Software Reuse Researcher
MSc Candidate at Federal University of Pernambuco
RiSE Member - http://www.rise.com.br

E-mail: alexandre.martins@cesar.org.br
MSN: xandecmartins@hotmail.com
GTalk: alexandremartins@gmail.com
Skype: xandecmartins
Mobile: +55 (81) 9929-9548
Office: +55 (81) 3425-4787
Fax: +55 (81) 3425-4701

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message