Martini Searching Solr Documents
Searching for documents in a Solr index within Martini can be accomplished in three ways: using functions, utilizing a SolrClient object, or leveraging the Solr Search API. Each method caters to different use cases and levels of complexity.
Get the Code!
Scripts and examples related to this guide are available in the examples package available in the Lonti Marketplace. This includes demonstrations using functions from the SolrMethods class and other Solr-related functionality.
Using Functions
Functions provide a straightforward approach to search queries in Solr. The SolrMethods class offers convenient functions for this purpose. For instance:
1 2 3 4 5 6 7 8 | |
Using SolrClient
For a more direct interaction with the Solr core, the SolrMethods.solr(String) function returns a SolrClient object. This method is ideal for those familiar with SolrJ and Groovy.
1 2 3 4 5 | |
Using the Solr Search API
The Solr Search API provides an extended interface for querying documents. This method involves using Solr's SearchHandlers through a Solr-derived endpoint.
1 2 3 4 | |