-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Problems reindexing with @FieldBridge and @Analyzer annotat
PostPosted: Fri Dec 09, 2011 1:15 pm 
Newbie

Joined: Fri Dec 09, 2011 1:09 pm
Posts: 2
Hi,

I'm having problems reindexing from db, and i suspect it's because one of my fields is mapped with @FieldBridge annotation, where i have a list of items and i decide how to index them. When i reindex from db, i only get id, created, modified and location. None of the metadata is indexed. i suspect it has something to do with the @FieldBridge or @Analyzer. here's the mapping:

public class MediaItemEntity implements Serializable
{

@Id
@DocumentId
private String id;

@Column(name = "uri", length = 1000, nullable = false)
private String uri;

@Column(name = "sourceItemURI", length = 1000)
private String sourceItemURI;

@IndexedEmbedded()
@ManyToOne(cascade = {CascadeType.PERSIST,
CascadeType.MERGE})
private MediaLocationEntity location;

@Temporal(TemporalType.TIMESTAMP)
@Column(name = "created", updatable = false, nullable = false)
@Field(index = Index.UN_TOKENIZED)
@DateBridge(resolution = Resolution.DAY)
private Date created;

@Temporal(TemporalType.TIMESTAMP)
@Column(name = "modified", nullable = false)
@Field(index = Index.UN_TOKENIZED)
@DateBridge(resolution = Resolution.DAY)
private Date modified;

@CollectionOfElements()
@Type(type = "com.espn.metadatastore.impl.jpa.MetadataValueType")
@JoinTable(name = "media_item_metadata", joinColumns = @JoinColumn(name = "media_item_id"))
@Columns(columns = {@Column(name = "metadata_key"),
@Column(name = "readable_value"),
@Column(name = "object_value")})
@Field(bridge = @FieldBridge(impl = MetadataFieldsBridge.class), analyzer = @Analyzer(impl = MetadataFieldsAnalyzer.class))
private List<MetadataProperty> metadata;


@PrePersist
private void prePersist()
{

created = new Date();
modified = created;
}


@PreUpdate
private void preUpdate()
{

modified = new Date();
}


public String getId()
{
return id;
}


public void setId(String id)
{
this.id = id;
}


public String getUri()
{
return uri;
}


public void setUri(String uri)
{
this.uri = uri;
}


public MediaLocationEntity getLocation()
{
return location;
}


public void setLocation(MediaLocationEntity location)
{
this.location = location;
}


public void setMetadata(List<MetadataProperty> metadata)
{
this.metadata = metadata;
}


public List<MetadataProperty> getMetadata()
{
return metadata;
}


public Date getCreated()
{
return created;
}


public Date getModified()
{
return modified;
}


public void setCreated(Date created)
{
this.created = created;
}


public void setModified(Date modified)
{
this.modified = modified;
}


public String getSourceItemURI()
{
return sourceItemURI;
}


public void setSourceItemURI(String sourceItemURI)
{
this.sourceItemURI = sourceItemURI;
}


@Override
public int hashCode()
{
final int prime = 31;
int result = 1;
result = prime * result + ((uri == null) ? 0 : uri.hashCode());
return result;
}


@Override
public boolean equals(Object obj)
{
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
MediaItemEntity other = (MediaItemEntity) obj;
if (uri == null)
{
if (other.uri != null)
return false;
} else if (!uri.equals(other.uri))
return false;
return true;
}

}

Please help this is causing me lots of problems. Using hibernate search 3.0.1. Using FullTextEntityManager.index to reindex.

Thank you!


Top
 Profile  
 
 Post subject: Re: Problems reindexing with @FieldBridge and @Analyzer annotat
PostPosted: Mon Dec 12, 2011 7:40 am 
Hibernate Team
Hibernate Team

Joined: Fri Oct 05, 2007 4:47 pm
Posts: 2536
Location: Third rock from the Sun
Hi,
how does your MetadataFieldsBridge look like? and MetadataFieldsAnalyzer ?

Also, do you really need to use such a very old version?

_________________
Sanne
http://in.relation.to/


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.