[hibernate-issues] [Hibernate-JIRA] Commented: (HSEARCH-499) Pass a "filter" query to MassIndexing: index changed entity based on timestamp

Sanne Grinovero (JIRA) noreply at atlassian.com
Mon Jan 23 06:26:12 EST 2012


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

Sanne Grinovero commented on HSEARCH-499:
-----------------------------------------

thanks Marc. Technically the MassIndexer needs two queries:
a) return all primary keys of a type which needs to be indexed (this is to produce a scrollable result projecting the ID only)
b) A query to know in advance how many objects there are. This is mostly to provide accurate progress statistics.

So I need the user to provide some kind of filter which I could apply to generate both types, or ask the user to provide both queries. One complexity is that the user thread passing the object is working on a different Session instance than the thread which is going to generate query a), so parameters to the query should not be applied on the query directly but passed to be applied in a second step.
Basically it need to provide somthing equivalent to #withFilter(String countingHQLQuery, String idselectionHQLQuery, Map<String,Object> parametersNamesValuesMap)
but this isn't looking too good, nor is in any way safe to check for valid parameters, types or syntax. I guess we'll have to go with some compromise or we won't ever make this but better looking suggestions are welcome :)

> Pass a "filter" query to MassIndexing: index changed entity based on timestamp
> ------------------------------------------------------------------------------
>
>                 Key: HSEARCH-499
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HSEARCH-499
>             Project: Hibernate Search
>          Issue Type: New Feature
>          Components: massindexer
>            Reporter: Emmanuel Bernard
>            Assignee: Sanne Grinovero
>
> I was discussion the MassIndexer API. It would be nice to be able to filter the list of Entity ids to reindex based on a query:
> For example
> select u.id from User u where u.lastUpdate >= :yesterday
> or sue some kind of other flag.
> This would be a nice useful trick.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the hibernate-issues mailing list