[hibernate-issues] [Hibernate-JIRA] Commented: (HSEARCH-1076) Simple entity changes not reflected in index

Sanne Grinovero (JIRA) noreply at atlassian.com
Tue Mar 27 08:38:50 EDT 2012


    [ https://hibernate.onjira.com/browse/HSEARCH-1076?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=46092#comment-46092 ] 

Sanne Grinovero commented on HSEARCH-1076:
------------------------------------------

Hi Elmer,
I'm not sure either if this change belongs in the reflection manager (we'll discuss that..), but for sure the dirty checking should not fail identifying the dirty fields.
Could you please open a new issue and provide a test for this?

> Simple entity changes not reflected in index
> --------------------------------------------
>
>                 Key: HSEARCH-1076
>                 URL: https://hibernate.onjira.com/browse/HSEARCH-1076
>             Project: Hibernate Search
>          Issue Type: Bug
>          Components: engine
>    Affects Versions: 3.4.2, 4.1.0.CR2
>         Environment: Unit test on Ubuntu 11.10 x64
>            Reporter: Elmer van Chastelet
>            Priority: Critical
>              Labels: search
>
> I was unable to find a unit test which tests if an entity change on a searchable String field (probably also other types) is reflected in the index. That's probably the reason I came across this serious issue.
> I have changed an existing test to see if my expectations were true, and indeed: solely changing a String property (searchable) of an entity won't trigger an update to the index.
> I will add a unit test for this particular case. For now, the failing code from an altered existing test:
> {code:title=snippet from altered NestedEmbeddedTest.java}
> s.clear();
> tx = s.beginTransaction();
> product = ( Product ) s.get( Product.class, product.getId() );
> product.setNwField("value1");
> tx.commit();
> s.clear();
> session = Search.getFullTextSession( s );
> tx = s.beginTransaction();
> QueryParser parser2 = new QueryParser( TestConstants.getTargetLuceneVersion(), "nwField", TestConstants.standardAnalyzer );
> query = parser2.parse( "value1" );
> result = session.createFullTextQuery( query, Product.class ).list();
> assertEquals( "change on simple string field not reflected in root index", 1, result.size() );
> tx.commit();
> {code}
> {code:title=addition to Product.java}
> @Field(store = Store.YES)
> private String nwField;
> public String getNwField(){
>     return nwField;
> }
> public void setNwField(String fld){
>     nwField = fld;
> }
> {code}

--
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