Getting ride of vitro:keyword in lucene index, adding class names to lucene index.

This commit is contained in:
bdc34 2011-02-03 20:29:52 +00:00
parent e956a3668a
commit 5302a32096

View file

@ -96,6 +96,7 @@ public class Entity2LuceneDoc implements Obj2DocIface{
Individual ent = (Individual)obj;
String value;
Document doc = new Document();
String classPublicNames = "";
//DocId
String id = ent.getURI();
@ -146,13 +147,15 @@ public class Entity2LuceneDoc implements Obj2DocIface{
//rdf:type and ClassGroup
List<VClass> vclasses = ent.getVClasses(false);
for( VClass clz : vclasses){
log.debug( id + " as type " + clz.getURI() );
//document boost for given classes
if( clz.getSearchBoost() != null )
doc.setBoost( doc.getBoost() + clz.getSearchBoost() );
doc.add( new Field(term.RDFTYPE, clz.getURI(),
Field.Store.YES, Field.Index.NOT_ANALYZED));
if( clz.getName() != null )
classPublicNames = classPublicNames + " " + clz.getName();
//Classgroup URI
if( clz.getGroupURI() != null )
doc.add( new Field(term.CLASSGROUP_URI, clz.getGroupURI(),
@ -244,6 +247,7 @@ public class Entity2LuceneDoc implements Obj2DocIface{
value+= " "+ ( ((t=ent.getBlurb()) == null)?"":t );
value+= " "+ getKeyterms(ent);
value+= " " + classPublicNames;
List<DataPropertyStatement> dataPropertyStatements = ent.getDataPropertyStatements();
if (dataPropertyStatements != null) {
@ -370,15 +374,8 @@ public class Entity2LuceneDoc implements Obj2DocIface{
}
private String getKeyterms(Individual ent){
//List<String> terms = entityWADao.getKeywords(ent.getId());
List<String> terms = ent.getKeywords();
String rv = "";
if( terms != null ){
for( String term : terms){
rv += term + " ";
}
}
return rv;
/* bdc34: vitro:keywords are no longer being indexed */
return "";
}
public static float NAME_BOOST = 10;