Versions Compared

Key

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

...

The existing search index remains in place while the new index is being built. When the rebuild is complete, the new index replaces the old one, and the old index is deleted.

Customizing the index

Note

In progress

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.

...

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/api/cores/vivocore/schema

Excluding specific classes from the search index

Exclusions can be added to any file the vivo-home/rdf/display/everytime directory (or any other file directory read by VIVO during startup). You may want to overwrite searchIndexerConfigurationVivo.n3 to keep the search configuration in one place. You can exclude individual class types:

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

:vivoSearchExcluder_typeExcluder
    a   <java:edu.cornell.mannlib.vitro.webapp.searchindex.exclusions.ExcludeBasedOnType> ,
        <java:edu.cornell.mannlib.vitro.webapp.searchindex.exclusions.SearchIndexExcluder> ;
    :excludes
        "http://vivoweb.org/ontology/core#Grant" .

... or all class types within a certain namespace:

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

:vivoSearchExcluder_namespaceTypeExcluder
    a   <java:edu.cornell.mannlib.vitro.webapp.searchindex.exclusions.ExcludeBasedOnTypeNamespace> ,
        <java:edu.cornell.mannlib.vitro.webapp.searchindex.exclusions.SearchIndexExcluder> ;
    :excludes
        "http://purl.org/NET/c4dm/event.owl#" .

... or the URI of the object itself:

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

:vivoSearchExcluder_namespaceExcluder
    a   <java:edu.cornell.mannlib.vitro.webapp.searchindex.exclusions.ExcludeBasedOnNamespace> ,
        <java:edu.cornell.mannlib.vitro.webapp.searchindex.exclusions.SearchIndexExcluder> ;
    :excludes
        "http://localhost/graph/private/" .

How does VIVO contact Solr?

...