Merge branch 'develop' of git+ssh://github.com/vivo-project/Vitro into develop
This commit is contained in:
commit
578bc95b63
3 changed files with 40 additions and 35 deletions
|
@ -194,6 +194,9 @@
|
||||||
<field name="classLocalName" type="text" indexed="true" stored="true" multiValued="true"/>
|
<field name="classLocalName" type="text" indexed="true" stored="true" multiValued="true"/>
|
||||||
|
|
||||||
<field name="classgroup" type="string" 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="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"/>
|
<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="ALLTEXT" type="text" indexed="true" stored="true" multiValued="true"/>
|
||||||
<field name="ALLTEXTUNSTEMMED" type="textgen" indexed="true" stored="false" 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="THUMBNAIL" type="string" indexed="true" stored="true"/>
|
||||||
|
|
||||||
<field name="BETA" type="float" indexed="true" stored="true" multiValued="false"/>
|
<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 for storing locations of thumbnails -->
|
||||||
<field name="THUMBNAIL_URL" type="string" indexed="false" stored="true"/>
|
<field name="THUMBNAIL_URL" type="string" indexed="false" stored="true"/>
|
||||||
|
|
|
@ -3,31 +3,35 @@
|
||||||
package edu.cornell.mannlib.vitro.webapp.search;
|
package edu.cornell.mannlib.vitro.webapp.search;
|
||||||
|
|
||||||
public class VitroSearchTermNames {
|
public class VitroSearchTermNames {
|
||||||
|
|
||||||
/** Id of entity, vclass or tab */
|
/** Id of entity, vclass or tab */
|
||||||
public static String URI = "URI";
|
public static String URI = "URI";
|
||||||
/** search document id */
|
/** search document id */
|
||||||
public static String DOCID = "DocId";
|
public static String DOCID = "DocId";
|
||||||
/** java class of the object that the Doc represents. */
|
|
||||||
public static String JCLASS = "JCLASS";
|
|
||||||
/** rdf:type */
|
/** rdf:type */
|
||||||
public static String RDFTYPE = "type";
|
public static String RDFTYPE = "type";
|
||||||
/** rdf:type */
|
/** class names in human readable form of an individual*/
|
||||||
public static String CLASSGROUP_URI = "classgroup";
|
public static final String CLASSLOCALNAME = "classLocalName";
|
||||||
/** Modtime from db */
|
/** classgroups from the individual's rdf:types */
|
||||||
public static String MODTIME = "modTime";
|
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 */
|
/** time of index in msec since epoc */
|
||||||
public static String INDEXEDTIME= "indexedTime";
|
public static String INDEXEDTIME= "indexedTime";
|
||||||
|
|
||||||
/** text for 'full text' search, this is stemmed */
|
/** text for 'full text' search, this is stemmed */
|
||||||
public static String ALLTEXT = "ALLTEXT";
|
public static String ALLTEXT = "ALLTEXT";
|
||||||
/** text for 'full text' search, this is unstemmed for
|
/** text for 'full text' search, this is unstemmed for
|
||||||
* use with wildcards and prefix queries */
|
* 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 */
|
/** Does the individual have a thumbnail image? 1=yes 0=no */
|
||||||
public static final String THUMBNAIL = "THUMBNAIL";
|
public static final String THUMBNAIL = "THUMBNAIL";
|
||||||
/** class names in human readable form of an individual*/
|
/** download url location for thumbnail */
|
||||||
public static final String CLASSLOCALNAME = "classLocalName";
|
public static final String THUMBNAIL_URL = "THUMBNAIL_URL";
|
||||||
|
|
||||||
// Fields derived from rdfs:label
|
// Fields derived from rdfs:label
|
||||||
/** Raw rdfs:label: no lowercasing, no tokenizing, no stop words, no stemming **/
|
/** Raw rdfs:label: no lowercasing, no tokenizing, no stop words, no stemming **/
|
||||||
public static String NAME_RAW = "nameRaw"; //
|
public static String NAME_RAW = "nameRaw"; //
|
||||||
|
@ -44,6 +48,11 @@ public class VitroSearchTermNames {
|
||||||
|
|
||||||
/** rdfs:label lowercased, tokenized, stop words, stemmed **/
|
/** rdfs:label lowercased, tokenized, stop words, stemmed **/
|
||||||
public static String NAME_STEMMED = "nameStemmed";
|
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 **/
|
/** rdfs:label lowercased, untokenized, edge-n-gram-filtered for autocomplete on people names **/
|
||||||
public static String AC_NAME_UNTOKENIZED = "acNameUntokenized";
|
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.
|
/* There is currently no use case for an autocomplete search field that is tokenized but not stemmed.
|
||||||
public static String AC_NAME_UNSTEMMED = "acNameUnstemmed"; */
|
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 BETA = "BETA";
|
||||||
public static final String PHI = "PHI";
|
|
||||||
public static final String ADJACENT_NODES = "ADJACENT_NODES";
|
/** Source institution URL */
|
||||||
|
|
||||||
/** 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 */
|
|
||||||
public static final String SITE_URL = "siteURL";
|
public static final String SITE_URL = "siteURL";
|
||||||
|
|
||||||
/** source institution name */
|
/** Source institution name */
|
||||||
public static final String SITE_NAME = "siteName";
|
public static final String SITE_NAME = "siteName";
|
||||||
|
|
||||||
/** preferred title */
|
|
||||||
public static final String PREFERRED_TITLE = "PREFERRED_TITLE";
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -69,6 +69,7 @@ public class IndividualToSolrDocument {
|
||||||
//add classes, classgroups get if prohibited because of its class
|
//add classes, classgroups get if prohibited because of its class
|
||||||
StringBuffer classPublicNames = new StringBuffer("");
|
StringBuffer classPublicNames = new StringBuffer("");
|
||||||
addClasses(ind, doc, classPublicNames);
|
addClasses(ind, doc, classPublicNames);
|
||||||
|
addMostSpecificTypeUris( ind, doc );
|
||||||
|
|
||||||
log.debug(ind.getURI() + " post class boost: " + doc.getDocumentBoost());
|
log.debug(ind.getURI() + " post class boost: " + doc.getDocumentBoost());
|
||||||
|
|
||||||
|
@ -202,7 +203,6 @@ public class IndividualToSolrDocument {
|
||||||
|
|
||||||
doc.addField(term.ALLTEXT, alltext);
|
doc.addField(term.ALLTEXT, alltext);
|
||||||
doc.addField(term.ALLTEXTUNSTEMMED, alltext);
|
doc.addField(term.ALLTEXTUNSTEMMED, alltext);
|
||||||
doc.addField(term.ALLTEXT_PHONETIC, alltext);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -256,7 +256,7 @@ public class IndividualToSolrDocument {
|
||||||
if( vclasses == null || vclasses.isEmpty() ){
|
if( vclasses == null || vclasses.isEmpty() ){
|
||||||
throw new SkipIndividualException("Not indexing because individual has no classes");
|
throw new SkipIndividualException("Not indexing because individual has no classes");
|
||||||
}
|
}
|
||||||
|
|
||||||
for(VClass clz : vclasses){
|
for(VClass clz : vclasses){
|
||||||
if(clz.getURI() == null){
|
if(clz.getURI() == null){
|
||||||
continue;
|
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) {
|
protected void addLabel(Individual ind, SolrInputDocument doc) {
|
||||||
String value = "";
|
String value = "";
|
||||||
|
|
Loading…
Add table
Reference in a new issue