[hibernate-issues] [Hibernate-JIRA] Commented: (HSEARCH-213) Use FieldSelector and doc(int, fieldSelector) to only select the necessary fields

Emmanuel Bernard (JIRA) noreply at atlassian.com
Sat Jun 14 14:33:33 EDT 2008


    [ http://opensource.atlassian.com/projects/hibernate/browse/HSEARCH-213?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_30419 ] 

Emmanuel Bernard commented on HSEARCH-213:
------------------------------------------

The solution works great for simple cases, it loads only the necessary Fields of documents for a given query.

But a FieldBridge can add *any* field in a document (ie any name) so we cannot really filter by field name
(example composite PK field bridge do id.firstname, id.lastname)

Solution:

Add a new metadata to FieldBridge 
FieldBridge.fieldNameStrategy() EXACT, IN_NAMESPACE, NON_SAFE


check the targeted Classes, to determine the less safe field bridge name strategy (including the embedded objects...)

If one of them is NON_SAFE => don't filter ; 
if one of them is IN_NAMESPACE use a startWith FieldSelector
otherwise use EXACT

It seems to be a lot of effort for the benefit.

A downscale version is to use FieldSelector when no projection is used (entity load). We have to check id bridges but it probably worth it.

Thoughts?

> Use FieldSelector and doc(int, fieldSelector) to only select the necessary fields
> ---------------------------------------------------------------------------------
>
>                 Key: HSEARCH-213
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HSEARCH-213
>             Project: Hibernate Search
>          Issue Type: Improvement
>          Components: engine
>            Reporter: Emmanuel Bernard
>             Fix For: 3.1.0
>
>
> Not entirely what would be the impact as it defeats the Hits batch load (?)

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the hibernate-issues mailing list