[hibernate-dev] [infinispan-dev] [HSearch] DSL for Lucene queries (was: Re: Query module new API and configurations)
Emmanuel Bernard
emmanuel at hibernate.org
Tue Sep 8 10:29:55 EDT 2009
I am not confusing them :)
In Hibernate Search, a field comes from a property (of an entity) and
a bridge.
If you have a field name, you can in most cases extract the right
bridge (as we know the list of targeted entities for a given query).
PS: that means we might have to ask for the targeted entities when
building the query.
On 8 sept. 09, at 15:07, Sanne Grinovero wrote:
> 2009/9/8 Emmanuel Bernard <emmanuel at hibernate.org>:
>> I was expecting to guess the right type from the property name /
>> field name.
>>
>
> IMHO we are confusing 2 different discussions:
> one about selecting StringBridges
> one about selecting Analyzers;
>
> StringBridges can be guessed from the JavaType, Analyzers from the
> annotations.
> I was proposing this typesafe API for StringBridges now.
>
>> On 8 sept. 09, at 14:51, Sanne Grinovero wrote:
>>
>>> 2009/9/3 Emmanuel Bernard <emmanuel at hibernate.org>:
>>>>
>>>> I don't see how people would nicely have access to the right bridge
>>>> implementation
>>>>
>>>
>>> I did't mean to give a reference the the right bridge, just that
>>> if people
>>> were defining a custom bridge, they may use it.
>>> If they don't specify bridge, we select the appropriate one
>>> basing on the
>>> type
>>> provided.
>>>
>>> By selecting I mean using the ones in "builtInBridges" map in
>>> BridgeFactory;
>>> we could use the map by reading the type at runtime or overload the
>>> method:
>>>
>>> <T> void from(T lowerBoundary, StringBridge<T> bridge){
>>> ..
>>> }
>>> void from(int lowerBoundary){
>>> from( lowerBoundary, BridgeFactory.INTEGER);
>>> }
>>> void from(boolean lowerBoundary){
>>> from( lowerBoundary, BridgeFactory.BOOLEAN);
>>> }
>>>
>>> It's a bit verbose for us, but should be good to use.
>>
>>
More information about the hibernate-dev
mailing list