Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Panel
titleSolr index fields, VIVO 1.6


DocIdnameRaw PREFERRED_TITLE
URI

nameText

siteURL

ALLTEXTnameLowercasesiteName
ALLTEXTUNSTEMMEDnameLowercaseSingleValued THUMBNAIL
classgroup

nameUnstemmed

 THUMBNAIL_URL
typenameStemmedindexedTime 
mostSpecificTypeURIsacNameUntokenized timestamp
BETA

acNameStemmed

etag
PROHIBITED_FROM_TEXT_RESULTSNAME_PHONETIC 


When is the index updated?

...

Customizing the index

Note

In progress

  • Building the record
  • Exclusions

 

Creating custom fields

There are two parts to adding a custom field to VIVO's search index, defining the VIVO SPARQL query and defining the search engine's fields that will be populated.

Custom queries can be added to any file the vivo-home/rdf/display/everytime directory (or any other file directory read by VIVO during startup). Using searchIndexerConfigurationVivo.n3 as a template, create a query that returns the data you wish to add to the search index. For example, if you wanted to create a custom field for tracking open access publications :

Code Block
@prefix : <http://vitro.mannlib.cornell.edu/ns/vitro/ApplicationSetup#> .
@prefix rdfs:  <http://www.w3.org/2000/01/rdf-schema#> .

:vivodocumentModifier_openAccess
    a   <java:edu.cornell.mannlib.vitro.webapp.searchindex.documentBuilding.SelectQueryDocumentModifier> ,
        <java:edu.cornell.mannlib.vitro.webapp.searchindex.documentBuilding.DocumentModifier> ;
    rdfs:label "open access" ;
    :hasTargetField "open_access_s" ;
    :hasSelectQuery """
        PREFIX wos: <http://webofscience.com/ontology/wos#>
        SELECT ?status
        WHERE {
            ?uri wos:openAccess ?status .
        }
        LIMIT 1
        """ .


Second (at least in the case of Solr), you must add the new field to the search index schema. For Solr 6 and older, this can be defined directly in Solr's schema.xml at any time (schema.xml included with Vitro prior to v1.11 for reference). For later versions of Solr, schema.xml will be read during core creation, but will not read changes after the fact. Instead, you may add new fields using Solr's Schema API. For the above example, you could post:

Code Block
curl -X POST -H 'Content-type:application/json' --data-binary '{"add-field": {"name":"open_access_s", "type":"text", "multiValued":false, "stored":true}}' http://localhost:8983/solr/vivo/schema


  • Exclusions


How does VIVO contact Solr?

...

  • Need to tell VIVO how to contact Solr
    • Authorization tests, now obsolete
  • VIVO may start before Solr does. Usually does.

 

...