You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jackrabbit.apache.org by Torgeir Veimo <to...@netenviron.com> on 2009/12/09 07:36:08 UTC

temporary node for similarity search

Is there any way around not having to create a node when doing a
similarity search?

I'd like to find matches between person profile tags and nodes with
tags. The profiles are not stored in jcr though, so it looks like i
have to create a jcr node in order to use SimilaritySearch?

//element(*, nen:ad)[rep:similar(., '/nen:content/people/uid')]

Also, one requirement I have is to be able to show all ads, but sort
on number of matches on tags. Thus is it possible to do a similarity
search, where i also get back hits without any similarity, but with
lower score?

Currently we do this in java code, which require us to fetch all nodes
in a search result, which is a bit suboptimal.

--
-Tor

Re: temporary node for similarity search

Posted by Torgeir Veimo <to...@netenviron.com>.
2009/12/9 Marcel Reutegger <ma...@gmx.net>:
> Hi,
>
> On Wed, Dec 9, 2009 at 07:36, Torgeir Veimo <to...@netenviron.com> wrote:
>> Is there any way around not having to create a node when doing a
>> similarity search?
>>
>> I'd like to find matches between person profile tags and nodes with
>> tags. The profiles are not stored in jcr though, so it looks like i
>> have to create a jcr node in order to use SimilaritySearch?
>
> yes, the similarity function needs an existing node to start with.
>
> you could work around that by building your own query that mimics the
> similarity search.

Is there any example code out there for how to access the underlying
Lucene instance with jackrabbit?

-- 
-Tor

Re: temporary node for similarity search

Posted by Marcel Reutegger <ma...@gmx.net>.
Hi,

On Wed, Dec 9, 2009 at 07:36, Torgeir Veimo <to...@netenviron.com> wrote:
> Is there any way around not having to create a node when doing a
> similarity search?
>
> I'd like to find matches between person profile tags and nodes with
> tags. The profiles are not stored in jcr though, so it looks like i
> have to create a jcr node in order to use SimilaritySearch?

yes, the similarity function needs an existing node to start with.

you could work around that by building your own query that mimics the
similarity search.

see: http://lucene.apache.org/java/2_0_0/api/org/apache/lucene/search/similar/MoreLikeThis.html
for how this works behind the scenes.

regards
 marcel

> //element(*, nen:ad)[rep:similar(., '/nen:content/people/uid')]
>
> Also, one requirement I have is to be able to show all ads, but sort
> on number of matches on tags. Thus is it possible to do a similarity
> search, where i also get back hits without any similarity, but with
> lower score?
>
> Currently we do this in java code, which require us to fetch all nodes
> in a search result, which is a bit suboptimal.
>
> --
> -Tor
>