Table Of Contents

Previous topic

Managing media

Next topic

Visualization

This Page

Managing Solr

Solr is a search engine that supports full-text search of indexed documents, plus features for categorization and data filtering. Managing Solr properly is critical to provide easy user access to uploaded Ontology objects. Solr should not be directly dealed with, but through REST services that read from JSON Mapping specifications (already introduced in Configuration).

Clear

Clears all indexed data (commits automatically)

Service path: http://{host:port}/{appname}/solr/clear
HTTP Method: GET
Returns: "success" or "error"

Commit

Commits recent index (not necessary)

Service path: http://{host:port}/{appname}/solr/commit
HTTP Method: GET
Returns: media file

Schema

Generates schema from mapping JSON configuration.

Service path: http://{host:port}/{appname}/solr/clear
HTTP Method: GET
Returns: "success" or "error"

NOTE: Solr must be restarted for new schema to take effect.

Reload

Peforms an update removing any existing data index. This process may take some time.

Solr index can be found at (SOLR_PATH)/data.xml

Service path: http://{host:port}/{appname}/solr/reload
HTTP Method: GET
Returns: "success" or "error"

Update

Indexes objects introduced or modified within the last M minutes (default is 60 minutes).

Solr index can be found at (SOLR_PATH)/data.xml

Note that this service does not update index reflecting objects that have been deleted, to do so, use “reload” service.

Service path: http://{host:port}/{appname}/solr/update?time=MINUTES
HTTP Method: GET
Returns: "success" or "error"

Autocomplete

Performs autocomplete of a given search string, JSON result comes straight from Solr engine.

Service path: http://{host:port}/{appname}/solr/autocomplete?s=Search
HTTP Method: GET
Returns: Solr JSON result or "error"

“s” Search parameter, contains general text search.

Autocomplete Example

http://internetdomain.org/ac/solr/autocomplete?s=Ja

OK Result

{
    + "responseHeader": { ... },                    // Not relevant
    + "response": { ... },                          // In autocomplete main response is neither relevant
    - "facet_counts": {

         - "facet_fields": {
                - "Birth": [ ]
                - "Country": [
                    + "Jamaica","1",
                    + "Japan","1",
                 ]
                - "Person": [
                    + "Jack the ripper","1",
                    + "James Bond","1",
                    + "James Franco","1"
                    + "James Stewart","1"
                 ]
            }
        }
}

Note that in autocomplete search, the faceted results comprise the fields marked as “autocomplete” in mapping.json (see Configuration).

Search configurations

It is possible to customize search modes from server side. This is done by editing or creating the search.json in CONFIGURATIONS_PATH/mapping/ folder. Configuring searches allowes to add extra filtering to client request to focus its searches to a particular scope. Say we want that, all searches focus only on Persons and Countries, ignoring other object types, and births from 1900 to 1950; the proper search.json would be as follows:

{
    "name":"mycustomsearch"
    "type":"search",
    "value":["ObjectType:Person", "ObjectType:Country", "Birth:[1900 TO 1950]" ]
},

{
    "name":"default"
    "type":"search"
    // it can be left blank if we do not need additional filtering
}

To use this search configuration, we add “config” parameter with value “mycustomsearch”

Search Example

http://internetdomain.org/ac/solr/search?s=James&config=mycustomsearch

If “config” is not specified, “default” search configuration is used. If there’s no such configuration or config value is not found in search.json, there’s no additional filtering.

To get the available search configurations, you can use this service:

Service path: http://{host:port}/{appname}/solr/configurations
HTTP Method: GET
Returns: Solr JSON result or "error"