You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-dev@jackrabbit.apache.org by Tommaso Teofili <te...@adobe.com> on 2012/12/05 15:03:55 UTC
question about IndexRow API
Hi all,
while trying to implement a custom IndexRow for the SolrQueryEngine i found myself wondering how that should be done in a correct way.
IndexRow API has two methods :
- String getPath();
- PropertyStateValue getValue(String columnName);
I wonder how a custom implementation would behave with respect to the getValue() method, I mean that it should return a PropertyStateValue but, as far as I could see so far, the PropertyStateValue constructor is protected (so cannot be directly instantiated) and the utility methods in PropertyValues, though calling new PropertyStateValue(...), return the PropertyValue interface.
So my question is: how could I create a PropertyStateValue instance without doing an ugly cast from PropertyValue ?
Thanks in advance and sorry if this sounds stupid :-)
Tommaso
Re: question about IndexRow API
Posted by Tommaso Teofili <te...@adobe.com>.
Thanks Thomas :-)
Tommaso
On 05/dic/2012, at 15:39, Thomas Mueller wrote:
> Hi,
>
> It looks like it should be a PropertyValue, and not a PropertyStateValue.
> I will fix it.
>
> The easiest solution is to return null for now :-) because actually, the
> method is currently not used within the query engine. It is planned for
> pseudo-properties such as jcr:score (see the documentation).
>
>
> Regards,
> Thomas
>
>
>
> On 12/5/12 3:03 PM, "Tommaso Teofili" <te...@adobe.com> wrote:
>
>> Hi all,
>>
>> while trying to implement a custom IndexRow for the SolrQueryEngine i
>> found myself wondering how that should be done in a correct way.
>> IndexRow API has two methods :
>> - String getPath();
>> - PropertyStateValue getValue(String columnName);
>>
>> I wonder how a custom implementation would behave with respect to the
>> getValue() method, I mean that it should return a PropertyStateValue but,
>> as far as I could see so far, the PropertyStateValue constructor is
>> protected (so cannot be directly instantiated) and the utility methods in
>> PropertyValues, though calling new PropertyStateValue(...), return the
>> PropertyValue interface.
>> So my question is: how could I create a PropertyStateValue instance
>> without doing an ugly cast from PropertyValue ?
>>
>> Thanks in advance and sorry if this sounds stupid :-)
>> Tommaso
>
Re: question about IndexRow API
Posted by Thomas Mueller <mu...@adobe.com>.
Hi,
It looks like it should be a PropertyValue, and not a PropertyStateValue.
I will fix it.
The easiest solution is to return null for now :-) because actually, the
method is currently not used within the query engine. It is planned for
pseudo-properties such as jcr:score (see the documentation).
Regards,
Thomas
On 12/5/12 3:03 PM, "Tommaso Teofili" <te...@adobe.com> wrote:
>Hi all,
>
>while trying to implement a custom IndexRow for the SolrQueryEngine i
>found myself wondering how that should be done in a correct way.
>IndexRow API has two methods :
>- String getPath();
>- PropertyStateValue getValue(String columnName);
>
>I wonder how a custom implementation would behave with respect to the
>getValue() method, I mean that it should return a PropertyStateValue but,
>as far as I could see so far, the PropertyStateValue constructor is
>protected (so cannot be directly instantiated) and the utility methods in
>PropertyValues, though calling new PropertyStateValue(...), return the
>PropertyValue interface.
>So my question is: how could I create a PropertyStateValue instance
>without doing an ugly cast from PropertyValue ?
>
>Thanks in advance and sorry if this sounds stupid :-)
>Tommaso