Return-Path: Delivered-To: apmail-jackrabbit-dev-archive@www.apache.org Received: (qmail 74885 invoked from network); 22 Aug 2006 12:09:10 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 22 Aug 2006 12:09:09 -0000 Received: (qmail 54776 invoked by uid 500); 22 Aug 2006 12:09:09 -0000 Delivered-To: apmail-jackrabbit-dev-archive@jackrabbit.apache.org Received: (qmail 54471 invoked by uid 500); 22 Aug 2006 12:09:08 -0000 Mailing-List: contact dev-help@jackrabbit.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@jackrabbit.apache.org Delivered-To: mailing list dev@jackrabbit.apache.org Received: (qmail 54462 invoked by uid 99); 22 Aug 2006 12:09:08 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 22 Aug 2006 05:09:08 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of marcel.reutegger@gmx.net designates 213.165.64.20 as permitted sender) Received: from [213.165.64.20] (HELO mail.gmx.net) (213.165.64.20) by apache.org (qpsmtpd/0.29) with SMTP; Tue, 22 Aug 2006 05:09:07 -0700 Received: (qmail invoked by alias); 22 Aug 2006 12:08:45 -0000 Received: from bsl-rtr.day.com (EHLO [10.0.0.70]) [212.249.34.130] by mail.gmx.net (mp027) with SMTP; 22 Aug 2006 14:08:45 +0200 X-Authenticated: #894343 Message-ID: <44EAF3CA.4010706@gmx.net> Date: Tue, 22 Aug 2006 14:08:42 +0200 From: Marcel Reutegger User-Agent: Thunderbird 1.5 (Windows/20051201) MIME-Version: 1.0 To: dev@jackrabbit.apache.org Subject: Re: Search with the SQL language and conditions References: <11320557.1156241242475.JavaMail.www@wwinf4006> In-Reply-To: <11320557.1156241242475.JavaMail.www@wwinf4006> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Y-GMX-Trusted: 0 X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Expressions on the pseudo property jcr:path are very limited and will in general only work in a reasonable way when you limit the nodes to a certain subtree of the workspace. e.g. jcr:path like '/foo/bar/%' XPath might do the job: //element(oliver, nt:file) will return all nt:file nodes named 'oliver'. Jackrabbit also puts the node name into the fulltext index, which means you could to this: select * from nt:file where contains(*,'oliver') or //element(*, nt:file)[jcr:contains(*,'oliver')] regards marcel olivier wrote: > Hi, > I would search files in the repository. I use SQL language. > Here my code : > String keywords = "olivier"; > String querySQL = "SELECT * FROM " + "nt:file" +" WHERE jcr:path Like '%" + keywords + "%'"; > QueryManager queryManager = session.getWorkspace().getQueryManager(); > Query query = queryManager.createQuery(querySQL,"sql"); > QueryResult queryResult = query.execute(); > System.out.println("noombre de resultats : " + queryResult.getRows().getSize()); > I obtain no error, but no results. When i delete the condition "where...", I recover all the files. > Why don't it function with the condition "where..."? > Somebody can he help me? > Olivier