You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by Ard Schrijvers <a....@hippo.nl> on 2007/08/23 13:29:33 UTC

LuceneQueryBuilder.createQuery(....)

Hello,

there seems to be two LuceneQueryBuilder.createQuery methods, where the first looks like:

public static Query createQuery(QueryRootNode root,
                                    SessionImpl session,
                                    ItemStateManager sharedItemMgr,
                                    NamespaceMappings nsMappings,
                                    Analyzer analyzer,
                                    PropertyTypeRegistry propReg)
            throws RepositoryException {
            return createQuery(root, session, sharedItemMgr, 
                nsMappings, analyzer, propReg, null);
}

This one never seems to be called AFAICS. Is this still there for legacy reasons? I need to know this, because for implementing backwards compatible JCR-1064, I need to add a parameter to LuceneQueryBuilder.createQuery() in QueryImpl that indicates new index format. Now, the method above is never used AFAICS, but I need to add in 

return createQuery(root, session, sharedItemMgr, 
                nsMappings, analyzer, propReg, null);

a parameter that states wether index format is new or old. So, can this method be removed, or should I add default newFormat=true or false parameter? WDOT?

Regards Ard

-- 

Hippo
Oosteinde 11
1017WT Amsterdam
The Netherlands
Tel  +31 (0)20 5224466
-------------------------------------------------------------
a.schrijvers@hippo.nl/ ard@apache.org / http://www.hippo.nl
-------------------------------------------------------------- 

Re: LuceneQueryBuilder.createQuery(....)

Posted by Marcel Reutegger <ma...@gmx.net>.
Christoph Kiehl wrote:
> Ard Schrijvers wrote:
>> Hello,
>>
>> there seems to be two LuceneQueryBuilder.createQuery methods, where 
>> the first looks like:
>>
>> public static Query createQuery(QueryRootNode root,
>>                                     SessionImpl session,
>>                                     ItemStateManager sharedItemMgr,
>>                                     NamespaceMappings nsMappings,
>>                                     Analyzer analyzer,
>>                                     PropertyTypeRegistry propReg)
>>             throws RepositoryException {
>>             return createQuery(root, session, sharedItemMgr, 
>>                 nsMappings, analyzer, propReg, null);
>> }
>>
>> This one never seems to be called AFAICS. Is this still there for 
>> legacy reasons? I need to know this, because for implementing 
>> backwards compatible JCR-1064, I need to add a parameter to 
>> LuceneQueryBuilder.createQuery() in QueryImpl that indicates new index 
>> format. Now, the method above is never used AFAICS, but I need to add in 
> 
> Hm, maybe Marcel can comment on this one? I see not reason for the 
> method to stay. But there probably is, otherwise Marcel would have 
> removed it when introducing synonyms. Or is it just a relict?

We can remove the method. If there's code out there using it, it can easily be 
adapted to use the new method.

I'll create a jira issue.

regards
  marcel

Re: LuceneQueryBuilder.createQuery(....)

Posted by Christoph Kiehl <ch...@sulu3000.de>.
Ard Schrijvers wrote:
> Hello,
> 
> there seems to be two LuceneQueryBuilder.createQuery methods, where the first looks like:
> 
> public static Query createQuery(QueryRootNode root,
>                                     SessionImpl session,
>                                     ItemStateManager sharedItemMgr,
>                                     NamespaceMappings nsMappings,
>                                     Analyzer analyzer,
>                                     PropertyTypeRegistry propReg)
>             throws RepositoryException {
>             return createQuery(root, session, sharedItemMgr, 
>                 nsMappings, analyzer, propReg, null);
> }
> 
> This one never seems to be called AFAICS. Is this still there for legacy reasons? I need to know this, because for implementing backwards compatible JCR-1064, I need to add a parameter to LuceneQueryBuilder.createQuery() in QueryImpl that indicates new index format. Now, the method above is never used AFAICS, but I need to add in 

Hm, maybe Marcel can comment on this one? I see not reason for the method to 
stay. But there probably is, otherwise Marcel would have removed it when 
introducing synonyms. Or is it just a relict?

Cheers,
Christoph