Skip to content

Overview

Concepts and Principles

Development

Overview

IDEs

API Explorer

Releases

Release Notes

TORO Integrate

Coder Studio

Coder Cloud

Bug Reports

Search

Search Indices

Introduction

Search indices play a vital role in TORO Integrate. Monitor and Tracker are the primary structures that allow for throttling, monetization, and invocation auditing and troubleshooting. Aside from these two pre-configured search indices, custom search indices can be created and linked to your packages to store additional data1 so that you may use these data to create reports and use them in your integrations, among many other possible things.

The examples package shows how you can use one-liners from the SolrMethods class and HTTP client services to index and/or query data from a custom search index, the Tracker search index, and the Monitor search index. Example services are written in Gloop and can be found under the solr code directory.

Monitor and Tracker Search Index Services

The following services below are present both in the solr.customTrackerSearch and solr.customMonitorSearch packages, and demonstrate how to query the Tracker and Monitor search indices, respectively.

Service Name Description
ListFacetCountEndpoint.gloop Queries the Solr index and generates a facet count.
ListFacetTermsEndpoint.gloop List down all the terms under the specified facet field.
ListPivotFacetEndpoint.gloop Queries the Solr index and generates a table summarizing the results.
ListStatisticsEndpoint.gloop Queries the Solr index and generates a simple statistics.
GetFacetCountEndpoint.gloop Similar to the List Face Count API but limits to a single facet field.
GetStatisticsEndpoint.gloop Similar to List Statistics API but limits to a single facet field.
RangeFacetEndpoint.gloop Uses range faceting on a date field or a numeric field that supports range queries.
RequestHandlerEndpoint.gloop Demonstrates the use of the TORO Integrate-exposed native Solr API.

More information...

These services make direct HTTP calls to the Solr server to send queries and receive search results. You can learn more about the exposed Solr endpoints by reading the Solr Search API.

Indexing operations

Check out TrackerMethods to see one-liners for retrieving, adding, and querying Tracker documents programmatically.

Custom Search Index Services

The following services under solr.customSolrCore demonstrate how to add and query documents from custom search indices:

Service Name Description
MovieIndexer.gloop Adds a new document to the custom Solr core.
MovieSearcher.gloop Queries the custom Solr core index.

More information...

These services are more thoroughly discussed in Creating, Reading, Updating, and Deleting Documents in your Custom Search Index.

Try It!

Under the Coder Navigator, expand the examples package entry and navigate to the code folder. Afterwards, look for the solr package. This package contains files and directories shown below:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
examples
├── ...
└── code
    └── solr
        ├── config
        │   ├── CreateAdminUser.gloop
        │   └── DeleteAdminUser.gloop
        ├── customMonitorSearch
        │   ├── GetFacetCountEndpoint.gloop
        │   ├── GetStatisticsEndpoint.gloop
        │   ├── ListFacetCountEndpoint.gloop
        │   ├── ListFacetTermsEndpoint.gloop
        │   ├── ListPivotFacetEndpoint.gloop
        │   ├── ListStatisticsEndpoint.gloop
        │   ├── RangeFacetEndpoint.gloop
        │   └── RequestHandlerEndpoint.gloop
        ├── customSolrCore
        │   ├── MovieIndexer.gloop
        │   ├── MovieSearcher.gloop
        │   └── MovieSolrAPI.groovy
        └── customTrackerSearch
            ├── GetFacetCountEndpoint.gloop
            ├── GetStatisticsEndpoint.gloop
            ├── ListFacetCountEndpoint.gloop
            ├── ListFacetTermsEndpoint.gloop
            ├── ListPivotFacetEndpoint.gloop
            ├── ListStatisticsEndpoint.gloop
            ├── RangeFacetEndpoint.gloop
            └── RequestHandlerEndpoint.gloop

Open and run any of the services under solr.customMonitorSearch, solr.customSolrCore, and solr.customTrackerSearch to inspect their contents and observe how they work.

How It Works...

The example services that query the Monitor and Tracker search indices use HTTP client services to direct the queries to the Solr server. The response received by the Gloop service will then be converted to a Gloop model.

You can query custom Solr indices using HTTP calls, too!

All search indices can be managed using TORO Integrate's extended Solr Search API.

Meanwhile, example services for custom search indices show how to add and query documents via SolrMethods one-liners.


  1. Possibly from your own integrations.