jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alexander Klimetschek <aklim...@adobe.com>
Subject Re: count function in query?
Date Thu, 21 Nov 2013 22:32:12 GMT
On 21.11.2013, at 02:43, ilijas <ilijastojkovic@yahoo.com> wrote:

> I have same problem with matching similar articles by tags. I want to show
> related articles based on tags.
> I tried: 
> SELECT * FROM [nt:unstructured] AS t WHERE (t.tags LIKE '%Tag1%' OR t.tags
> LIKE '%Tag2%') ORDER BY length(tags) DESC
> 
> It would be nice if I can do next: 
> 
> SELECT * FROM [nt:unstructured] AS t WHERE (t.tags LIKE '%Tag1%' OR t.tags
> LIKE '%Tag2%') ORDER BY (length(tags) - length(replace(tags, 'Tag1', '')) -
> length(replace(tags, 'Tag2', '')) )DESC
> 
> but, I can't. If someone has some idea how to solve this, please share with
> us.

No, sorry, such functions are not available in jcr sql1 or sql2. You can only do the sorting
on the application layer.

Oak lights up things a bit in that it allows custom search indexes to hook in, if you want
to take a look at it.

Cheers,
Alex

Mime
View raw message