You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by Martin Perez <mp...@gmail.com> on 2005/10/27 13:30:42 UTC

Fwd: Score and searching

Hi. I'm a little confused about how to obtain score values when performing
search operations.

Which one will be the correct process?

1 - Perform a search operation
2 - Go through QueryResult RowIterator and NodeIterator simultaneously. With
NodeIterator you get the node and with RowIterator you get the score. I'm
assuming that NodeIterator and RowIterator return data in the same order.

or

1 - Perform a search operation
2 - Use only QueryResult RowIterator. You get the score and path property,
and with the path property you obtain the Item through the session object.
But as a drawback you have to do a cast to javax.jcr.Node and you must
assume that a path property should be present.

Re: Fwd: Score and searching

Posted by Martin Perez <mp...@gmail.com>.
Thanks Marcel, I didn't saw that point of the spec.

Best regards,

Martin

On 10/27/05, Marcel Reutegger <ma...@gmx.net> wrote:
>
> Hi Martin,
>
> I'd say both are correct and feasible. personally I prefer the second
> approach because I don't have to use two iterators simultaneously.
>
> the jcr:path property *must* always be present in a result row, see
> section 8.5.2.2 <http://8.5.2.2> of the spec. so, you can be sure that it
> is always there.
>
> regards
> marcel
>
> Martin Perez wrote:
> > Hi. I'm a little confused about how to obtain score values when
> performing
> > search operations.
> >
> > Which one will be the correct process?
> >
> > 1 - Perform a search operation
> > 2 - Go through QueryResult RowIterator and NodeIterator simultaneously.
> With
> > NodeIterator you get the node and with RowIterator you get the score.
> I'm
> > assuming that NodeIterator and RowIterator return data in the same
> order.
> >
> > or
> >
> > 1 - Perform a search operation
> > 2 - Use only QueryResult RowIterator. You get the score and path
> property,
> > and with the path property you obtain the Item through the session
> object.
> > But as a drawback you have to do a cast to javax.jcr.Node and you must
> > assume that a path property should be present.
> >
>

Re: Fwd: Score and searching

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

I'd say both are correct and feasible. personally I prefer the second 
approach because I don't have to use two iterators simultaneously.

the jcr:path property *must* always be present in a result row, see 
section 8.5.2.2 of the spec. so, you can be sure that it is always there.

regards
  marcel

Martin Perez wrote:
> Hi. I'm a little confused about how to obtain score values when performing
> search operations.
> 
> Which one will be the correct process?
> 
> 1 - Perform a search operation
> 2 - Go through QueryResult RowIterator and NodeIterator simultaneously. With
> NodeIterator you get the node and with RowIterator you get the score. I'm
> assuming that NodeIterator and RowIterator return data in the same order.
> 
> or
> 
> 1 - Perform a search operation
> 2 - Use only QueryResult RowIterator. You get the score and path property,
> and with the path property you obtain the Item through the session object.
> But as a drawback you have to do a cast to javax.jcr.Node and you must
> assume that a path property should be present.
>