Merge branch 'develop' of git+ssh://github.com/vivo-project/Vitro into develop

This commit is contained in:
j2blake 2013-07-25 11:55:03 -04:00
commit 578bc95b63
3 changed files with 40 additions and 35 deletions

View file

@ -194,6 +194,9 @@
<field name="classLocalName" type="text" indexed="true" stored="true" multiValued="true"/>
<field name="classgroup" type="string" indexed="true" stored="true" multiValued="true"/>
<field name="mostSpecificTypeURIs" type="string" indexed="true" stored="true" omitNorms="true" multiValued="true"/>
<field name="PROHIBITED_FROM_TEXT_RESULTS" type="string" indexed="true" stored="false" omitNorms="true" multiValued="true"/>
<field name="URI" type="string" indexed="true" stored="true" multiValued="false" omitNorms="true"/>
@ -217,16 +220,10 @@
<field name="ALLTEXT" type="text" indexed="true" stored="true" multiValued="true"/>
<field name="ALLTEXTUNSTEMMED" type="textgen" indexed="true" stored="false" multiValued="true"/>
<field name="ALLTEXT_PHONETIC" type="phonetic" indexed="true" stored="false" multiValued="true"/>
<field name="THUMBNAIL" type="string" indexed="true" stored="true"/>
<field name="BETA" type="float" indexed="true" stored="true" multiValued="false"/>
<!-- <field name="PHI" type="float" indexed="true" stored="true" multiValued="false"/>
<field name="ADJACENT_NODES" type="string" indexed="true" stored="true" multiValued="true"/> -->
<field name="modType" type="ignored"/>
<field name="JCLASS" type="ignored"/>
<!-- field for storing locations of thumbnails -->
<field name="THUMBNAIL_URL" type="string" indexed="false" stored="true"/>

View file

@ -3,31 +3,35 @@
package edu.cornell.mannlib.vitro.webapp.search;
public class VitroSearchTermNames {
/** Id of entity, vclass or tab */
public static String URI = "URI";
/** search document id */
public static String DOCID = "DocId";
/** java class of the object that the Doc represents. */
public static String JCLASS = "JCLASS";
/** rdf:type */
public static String RDFTYPE = "type";
/** rdf:type */
public static String CLASSGROUP_URI = "classgroup";
/** Modtime from db */
public static String MODTIME = "modTime";
/** class names in human readable form of an individual*/
public static final String CLASSLOCALNAME = "classLocalName";
/** classgroups from the individual's rdf:types */
public static String CLASSGROUP_URI = "classgroup";
/** Most specific types for individual*/
public static String MOST_SPECIFIC_TYPE_URIS = "mostSpecificTypeURIs";
/** time of index in msec since epoc */
public static String INDEXEDTIME= "indexedTime";
/** text for 'full text' search, this is stemmed */
public static String ALLTEXT = "ALLTEXT";
/** text for 'full text' search, this is unstemmed for
* use with wildcards and prefix queries */
public static String ALLTEXTUNSTEMMED = "ALLTEXTUNSTEMMED";
public static String ALLTEXTUNSTEMMED = "ALLTEXTUNSTEMMED";
/** Does the individual have a thumbnail image? 1=yes 0=no */
public static final String THUMBNAIL = "THUMBNAIL";
/** class names in human readable form of an individual*/
public static final String CLASSLOCALNAME = "classLocalName";
/** download url location for thumbnail */
public static final String THUMBNAIL_URL = "THUMBNAIL_URL";
// Fields derived from rdfs:label
/** Raw rdfs:label: no lowercasing, no tokenizing, no stop words, no stemming **/
public static String NAME_RAW = "nameRaw"; //
@ -44,6 +48,11 @@ public class VitroSearchTermNames {
/** rdfs:label lowercased, tokenized, stop words, stemmed **/
public static String NAME_STEMMED = "nameStemmed";
/** preferred title */
public static final String PREFERRED_TITLE = "PREFERRED_TITLE";
public static final String NAME_PHONETIC = "NAME_PHONETIC";
/** rdfs:label lowercased, untokenized, edge-n-gram-filtered for autocomplete on people names **/
public static String AC_NAME_UNTOKENIZED = "acNameUntokenized";
@ -55,24 +64,13 @@ public class VitroSearchTermNames {
/* There is currently no use case for an autocomplete search field that is tokenized but not stemmed.
public static String AC_NAME_UNSTEMMED = "acNameUnstemmed"; */
/** field for beta values of all documents **/
/** Beta values used in weighting **/
public static final String BETA = "BETA";
public static final String PHI = "PHI";
public static final String ADJACENT_NODES = "ADJACENT_NODES";
/** adding phonetic field **/
public static final String ALLTEXT_PHONETIC = "ALLTEXT_PHONETIC";
public static final String NAME_PHONETIC = "NAME_PHONETIC";
/** download url location for thumbnail */
public static final String THUMBNAIL_URL = "THUMBNAIL_URL";
/** source institution url */
/** Source institution URL */
public static final String SITE_URL = "siteURL";
/** source institution name */
/** Source institution name */
public static final String SITE_NAME = "siteName";
/** preferred title */
public static final String PREFERRED_TITLE = "PREFERRED_TITLE";
}

View file

@ -69,6 +69,7 @@ public class IndividualToSolrDocument {
//add classes, classgroups get if prohibited because of its class
StringBuffer classPublicNames = new StringBuffer("");
addClasses(ind, doc, classPublicNames);
addMostSpecificTypeUris( ind, doc );
log.debug(ind.getURI() + " post class boost: " + doc.getDocumentBoost());
@ -202,7 +203,6 @@ public class IndividualToSolrDocument {
doc.addField(term.ALLTEXT, alltext);
doc.addField(term.ALLTEXTUNSTEMMED, alltext);
doc.addField(term.ALLTEXT_PHONETIC, alltext);
}
@ -256,7 +256,7 @@ public class IndividualToSolrDocument {
if( vclasses == null || vclasses.isEmpty() ){
throw new SkipIndividualException("Not indexing because individual has no classes");
}
for(VClass clz : vclasses){
if(clz.getURI() == null){
continue;
@ -286,6 +286,16 @@ public class IndividualToSolrDocument {
}
}
}
protected void addMostSpecificTypeUris(Individual ind, SolrInputDocument doc){
List<String> mstURIs = ind.getMostSpecificTypeURIs();
if( mstURIs != null ){
for( String typeURI : mstURIs ){
if( typeURI != null && ! typeURI.trim().isEmpty() )
doc.addField(term.MOST_SPECIFIC_TYPE_URIS, typeURI);
}
}
}
protected void addLabel(Individual ind, SolrInputDocument doc) {
String value = "";