[hibernate-issues] [Hibernate-JIRA] Commented: (HSEARCH-1049) includePaths bombs on inclusion of id members

Marc Schipperheyn (JIRA) noreply at atlassian.com
Thu Mar 15 08:57:50 EDT 2012


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

Marc Schipperheyn commented on HSEARCH-1049:
--------------------------------------------

Ad 1 
I think we should log a warning if SubItem is @Indexed and is reached through an IndexedEmbedded with includePaths. Something like
"@IndexedEmbedded {Item}->{SubItem}. Fields that are indexed in {SubItem} and that are not part of {Item.field.includePaths} may be indexed by indexing {SubItem} directly. "

Would also good to have this as part of the documentation
When using includePaths, you are only indexing the fields of {SubItem} that are specified in the includePaths statement. If {SubItem}  itself is also @Indexed, and there are @Fields in {SubItem} that are not part of the includePaths statement in {Item}, they will only be indexed by saving/indexing {SubItem} directly.

Ad 2 Is this what you mean?

{code}
@Indexed
public class Item {

@IndexedEmbedded(prefix="subitem.")
public List<SubItem> getSubItems() {
 ...
}
}
@Indexed
public class SubItem {

@IndexedEmbedded(prefix="item.",includePaths={"id"})
public List<Item> relatedItems() {
...
}
}
{code}

So, when we index SubItem from Index, we have an IndexedEmbedded in SubItem with an includePaths marker but without a depth marker. I would suggest that depth in this case should be set to default.

> includePaths bombs on inclusion of id members
> ---------------------------------------------
>
>                 Key: HSEARCH-1049
>                 URL: https://hibernate.onjira.com/browse/HSEARCH-1049
>             Project: Hibernate Search
>          Issue Type: Bug
>          Components: engine
>    Affects Versions: 4.1.0.Beta2
>            Reporter: Marc Schipperheyn
>            Priority: Blocker
>             Fix For: 4.1.0.Final
>
>
> When I include id members on includePaths, I get 
> Found invalid @IndexedEmbedded->paths configured on class nl.project.model.Item, member subitem: item.id
> I use ids a lot and in many cases they are all I'm interested in.
> E.g.
> @IndexedEmbedded(prefix="location.",includePaths={"city.id","city.city","country.id","city.region.id"})
> 	public Address getAddress() {
> 		return address;
> 	}
> will indicate all id fields as erronous.

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