Return-Path: X-Original-To: apmail-jackrabbit-users-archive@minotaur.apache.org Delivered-To: apmail-jackrabbit-users-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 21BED92B5 for ; Wed, 28 Mar 2012 12:46:34 +0000 (UTC) Received: (qmail 15181 invoked by uid 500); 28 Mar 2012 12:46:33 -0000 Delivered-To: apmail-jackrabbit-users-archive@jackrabbit.apache.org Received: (qmail 15146 invoked by uid 500); 28 Mar 2012 12:46:33 -0000 Mailing-List: contact users-help@jackrabbit.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@jackrabbit.apache.org Delivered-To: mailing list users@jackrabbit.apache.org Received: (qmail 15135 invoked by uid 99); 28 Mar 2012 12:46:33 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 28 Mar 2012 12:46:33 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [209.85.160.42] (HELO mail-pb0-f42.google.com) (209.85.160.42) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 28 Mar 2012 12:46:27 +0000 Received: by pbcun1 with SMTP id un1so2895525pbc.1 for ; Wed, 28 Mar 2012 05:46:06 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type :x-gm-message-state; bh=zXPD/JSPJfZAxbjLlvOS3BMuXh45Uuf2j2d1HQvPzKo=; b=GdqcVCrRGiCzJdF69R8d+3L0J2m23nsCKjI/mQPgiErvFIM5NfI7pVFv7tDDj0n48G W+blAIGZLpgjAU71mRpJsHcGL0Lw736OHCKVmhdkT7Job0rk0gWnkWUsILM7DSBAXNn6 wgivTt8rZgrbDunBDNPFHtcXvsgS9zodnXfmJgb5H2YWvsvkvF99hMVwnkwYl15uqJXD 5RbRm8yu0k7XVPdR10g76P3ouNyHJB7hpZxbMBGvold6TsT7BHEF8NyLi8YI2BJs1hmf JrHyT7dCFHIxY8yWcgCVPyWmzU9XZS6UgW0dRpSFhk8Jr7jxCPuj0YLdAcpopIEwdV68 viOg== MIME-Version: 1.0 Received: by 10.68.136.10 with SMTP id pw10mr72045322pbb.134.1332938766201; Wed, 28 Mar 2012 05:46:06 -0700 (PDT) Received: by 10.68.2.137 with HTTP; Wed, 28 Mar 2012 05:46:05 -0700 (PDT) Date: Wed, 28 Mar 2012 22:46:05 +1000 Message-ID: Subject: jcr:contains query issues From: Torgeir Veimo To: users@jackrabbit.apache.org Content-Type: text/plain; charset=ISO-8859-1 X-Gm-Message-State: ALoCoQkzuINFVfTXru7VP8O4M9ivmeFz5ytjwvF+YUWTriGSaDEmz5xjQRxxrLBu1TLqmU95yESJ X-Virus-Checked: Checked by ClamAV on apache.org I'm trying to query (using xpath xyntax) for a number of nodes with sorting based on how many tags on each node matches a set of tags. I'm currently trying to do this using //element(*, nt:base)[jcr:contains(@tagproperty, 'tag1 tag2 tag3')] order by @jcr:score but it doesn't work very well. Instead I can use //element(*, nt:base)[jcr:contains(@tagproperty, 'tag1') or jcr:contains(@tagproperty, 'tag2') or jcr:contains(@tagproperty, 'tag3')] order by @jcr:score but the query string can potentially become very large. Additionally, I'm also trying to include nodes that doesn't match any of the tags, but just sort them such that they end up below the matching nodes. This requires an additional 'dummy match', but I'm having trouble letting this dummy match have a lower boost than the jcr:contains, even when I boost the contains, (all nodes have a name property): //element(*, nt:base)[(jcr:contains(@tagproperty, 'tag1^10') or jcr:contains(@tagproperty, 'tag^10') or jcr:contains(@tagproperty, 'tag3^10') or @name)] order by @jcr:score Is there a better way of doing this? -- -Tor