public final class SolrMethods extends Object
Provides one-liners for performing Solr operations.
Included in this class are one-liners for
getting the SolrClient
of a Solr core,
executing query statements against a core,
easily creating schemas out of models,
and others.
Constructor and Description |
---|
SolrMethods(io.toro.martini.coder.development.SchemaWriter writer,
io.toro.martini.solr.SolrClientProvider<io.toro.martini.solr.MartiniSolrClient> solrClientProvider,
io.toro.martini.solr.SolrSearchServiceFactory solrSearchServiceFactory,
io.toro.martini.solr.PackageSolrCoreConfigurer packageSolrCoreConfigurer) |
Modifier and Type | Method and Description |
---|---|
static void |
addCore(String coreName,
String modelNamespace,
String uniqueKey,
String packageName)
Configures a Solr core with the schema based on a Gloop model.
|
static GloopModel |
deleteById(String coreName,
String packageName,
List<String> ids)
Delete Solr documents by ID.
|
static GloopModel |
deleteByQuery(String coreName,
String packageName,
String query)
Delete Solr documents by query.
|
static UpdateResponse |
deleteByQueryString(String coreName,
String packageName,
String query)
Delete Solr documents by query.
|
static GloopModel |
fieldStatisticsSearch(String coreName,
String packageName,
String fieldName,
List<GloopModel> solrParams)
Generate statistics for a certain field.
|
static io.toro.martini.solr.Stats |
fieldStatisticsSearch(String coreName,
String packageName,
String fieldName,
Map<String,Collection<String>> solrParams)
Generate statistics for a certain field.
|
static GloopModel |
fieldValueFacetSearch(String coreName,
String packageName,
String fieldName,
List<GloopModel> solrParams)
Perform a faceted search for a specific field.
|
static io.toro.martini.solr.Facet |
fieldValueFacetSearch(String coreName,
String packageName,
String fieldName,
Map<String,Collection<String>> solrParams)
Perform a faceted search for a specific field.
|
static void |
gloopModelToSolrSchema(String destination,
String packageName,
String modelNamespace)
Create a Solr schema based on a Gloop model.
|
static void |
gloopModelToSolrSchema(String destination,
String packageName,
String modelNamespace,
String uniqueKey)
Create a Solr schema based on a Gloop model.
|
static GloopCursor |
insertMany(String coreName,
String packageName,
String commitMode,
boolean closeClient,
GloopExecutionContext context)
Open a Gloop cursor that accepts Gloop models.
|
static GloopCursor |
insertMany(String coreName,
String packageName,
String commitMode,
boolean closeClient,
int batchSize,
GloopExecutionContext context)
Open a Gloop cursor that accepts Gloop models.
|
static GloopModel |
multiFieldStatisticsSearch(String coreName,
String packageName,
List<GloopModel> solrParams)
Generate statistics for one or more fields.
|
static List<io.toro.martini.solr.Stats> |
multiFieldStatisticsSearch(String coreName,
String packageName,
Map<String,Collection<String>> solrParams)
Generate statistics for one or more fields.
|
static GloopModel |
multiFieldValueFacetSearch(String coreName,
String packageName,
List<GloopModel> solrParams)
Perform a faceted search for a specific set of fields.
|
static List<io.toro.martini.solr.Facet> |
multiFieldValueFacetSearch(String coreName,
String packageName,
Map<String,Collection<String>> solrParams)
Perform a faceted search for a specific set of fields.
|
static GloopModel |
multiPivotFacetSearch(String coreName,
String packageName,
List<GloopModel> solrParams)
Perform a multi pivot faceted search.
|
static List<io.toro.martini.solr.PivotFacet> |
multiPivotFacetSearch(String coreName,
String packageName,
Map<String,Collection<String>> solrParams)
Perform a multi pivot faceted search.
|
static GloopModel |
pivotFacetSearch(String coreName,
String packageName,
String fieldName,
List<GloopModel> solrParams)
Perform a pivot faceted search for a specific field.
|
static io.toro.martini.solr.PivotFacet |
pivotFacetSearch(String coreName,
String packageName,
String fieldName,
Map<String,Collection<String>> solrParams)
Perform a pivot faceted search for a specific field.
|
static GloopModel |
query(String coreName,
String packageName,
List<GloopModel> solrParams)
Query a Solr core.
|
static QueryResponse |
query(String coreName,
String packageName,
Map<String,String> solrParams)
Query a Solr core.
|
static GloopModel |
rangeFacetSearch(String coreName,
String packageName,
String fieldName,
List<GloopModel> solrParams)
Perform a range faceted search for a specific field.
|
static <B,G> io.toro.martini.solr.RangeFacet<B,G> |
rangeFacetSearch(String coreName,
String packageName,
String fieldName,
Map<String,Collection<String>> solrParams)
Perform a range faceted search for a specific field.
|
static void |
removeCore(String coreName,
String packageName,
boolean removeFiles)
Removes an existing Solr core from a Martini package.
|
static GloopModel |
searchCore(String query,
String coreName,
String packageName,
String sortField,
String sortType,
List<String> fields,
int pageSize,
int page)
Search a Solr core.
|
static io.toro.martini.solr.MartiniSolrClient |
solr(String coreName)
Get the
SolrClient of a named Solr core, belonging to the package in the current context. |
static void |
solrSchemaToGloopModel(String name,
String schema,
String packageName,
String namespace,
List<GloopModel> resources)
Create a Gloop model based on a Solr schema.
|
static void |
solrSchemaToGloopModel(String name,
String schema,
String packageName,
String namespace,
Map<String,String> resources)
Create a Gloop model based on a Solr schema.
|
static GloopModel |
writeToIndex(String coreName,
String packageName,
GloopModel gloopModel)
Index a document.
|
static UpdateResponse |
writeToIndex(String coreName,
String packageName,
Object bean)
Index a document.
|
@Autowired SolrMethods(io.toro.martini.coder.development.SchemaWriter writer, io.toro.martini.solr.SolrClientProvider<io.toro.martini.solr.MartiniSolrClient> solrClientProvider, io.toro.martini.solr.SolrSearchServiceFactory solrSearchServiceFactory, io.toro.martini.solr.PackageSolrCoreConfigurer packageSolrCoreConfigurer)
@GloopObjectParameter(value="output{\nupdateResponse#io.toro.martini.solr.UpdateResponse{\n }\n}") public static GloopModel deleteById(@GloopParameter(allowNull=false) String coreName, String packageName, List<String> ids) throws SolrServerException, IOException
coreName
- the name of the Solr core where the document belongspackageName
- the name of the package where the Solr core resides;
if empty, this will assume the name of the package where the service is invokedids
- the IDs of all Solr documents to be deletedSolrServerException
- if there is an error on the serverIOException
- if there is a low-level I/O errorpublic static UpdateResponse deleteByQueryString(String coreName, String packageName, String query) throws SolrServerException, IOException
coreName
- the name of the Solr core where the document belongspackageName
- the name of the package where the Solr core resides;
if empty, this will assume the name of the package where the service is invokedquery
- query selecting which Solr documents to deleteSolrServerException
- if there is an error on the serverIOException
- if there is a low-level I/O error@GloopObjectParameter(value="output{\nupdateResponse#io.toro.martini.solr.UpdateResponse{\n }\n}") public static GloopModel deleteByQuery(@GloopParameter(allowNull=false) String coreName, String packageName, @GloopParameter(allowExtraProperties=false,allowNull=false) String query) throws SolrServerException, IOException
coreName
- the name of the Solr core where the document belongspackageName
- the name of the package where the Solr core resides;
if empty, this will assume the name of the package where the service is invokedquery
- query selecting which Solr documents to deleteSolrServerException
- if there is an error on the serverIOException
- if there is a low-level I/O errorpublic static void gloopModelToSolrSchema(@GloopParameter(allowNull=false) String destination, String packageName, @GloopParameter(allowNull=false) String modelNamespace) throws IOException
destination
- the destination directory of the to-be-generated Solr schemapackageName
- the name of the package where the Gloop model resides
if empty, this will assume the name of the package where the service is invokedmodelNamespace
- the namespace of the model to be used as the basis of the Solr schemaIOException
public static void gloopModelToSolrSchema(@GloopParameter(allowNull=false) String destination, String packageName, @GloopParameter(allowNull=false) String modelNamespace, @GloopParameter(defaultValue="id") String uniqueKey) throws IOException
destination
- the destination directory of the to-be-generated Solr schemapackageName
- the name of the package where the Gloop model resides
if empty, this will assume the name of the package where the service is invokedmodelNamespace
- the namespace of the model to be used as the basis of the Solr schemauniqueKey
- the unique key of the Solr schemaIOException
public static void addCore(@GloopParameter(allowNull=false) String coreName, @GloopParameter(allowNull=false) String modelNamespace, @GloopParameter(defaultValue="id") String uniqueKey, String packageName) throws IOException
coreName
- the name of the to-be-generate Solr coremodelNamespace
- the namespace of the model to be used as the basis of the Solr schemauniqueKey
- the unique key of the Solr schemapackageName
- the name of the package where the Solr core will be added
if empty, this will assume the name of the package where the service is invokedIOException
public static void removeCore(@GloopParameter(allowNull=false) String coreName, String packageName, @GloopParameter(defaultValue="false") boolean removeFiles)
coreName
- the name of the existing Solr corepackageName
- the name of the package where the Solr core resides
if empty, this will assume the name of the package where the service is invokedremoveFiles
- the flag that indicates whether to remove the core's configuration filespublic static void solrSchemaToGloopModel(String name, String schema, String packageName, String namespace, Map<String,String> resources)
Create a Gloop model based on a Solr schema. This one-liner allows you to provide external resources needed in order to parse the schema.
Consider the schema below:
This schema requires the external XML configuration file
enumConfig.xml
to identify the valid choices for the priorityLevel
field.
To satisfy this requirement, the caller must add an entry to the resources
map.
The value would be the name of the file, which is enumConfig.xml
, and the XML content of the file.
name
- the name of the to-be-generated modelschema
- the content of the Solr schema which will be used as the basis of the Gloop modelpackageName
- the name of the package where the Gloop model will reside;
if empty, this will assume the name of the package where the service is invokednamespace
- the namespace of the to-be-generated Gloop model;
this dictates where the model will resideresources
- a map of required resources (filename to file content) needed to properly parse the Solr schemapublic static void solrSchemaToGloopModel(@GloopParameter(allowNull=false) String name, @GloopParameter(allowNull=false) String schema, @GloopParameter(allowNull=false) String packageName, @GloopParameter(allowNull=false,defaultValue="model") String namespace, @GloopParameter(allowExtraProperties=false) @GloopObjectParameter(value="resources[]{\n resourceName\n resourceContent\n}") List<GloopModel> resources)
Create a Gloop model based on a Solr schema. This one-liner allows you to provide external resources needed in order to parse the schema.
Consider the schema below:
This schema requires the external XML configuration file
enumConfig.xml
to identify the valid choices for the priorityLevel
field.
To satisfy this requirement, the caller must add an entry to the resources
map.
The value would be the name of the file, which is enumConfig.xml
, and the XML content of the file.
name
- the name of the to-be-generated modelschema
- the content of the Solr schema which will be used as the basis of the Gloop modelpackageName
- the name of the package where the Gloop model will reside;
if empty, this will assume the name of the package where the service is invokednamespace
- the namespace of the to-be-generated Gloop model;
this dictates where the model will resideresources
- an array of required resources (each indicating the filename and file content)
needed to properly parse the Solr schemapublic static UpdateResponse writeToIndex(String coreName, String packageName, Object bean) throws IOException, SolrServerException
Index a document. This one-liner allows the caller to add a new document or update an existing one, depending on the provided arguments.
To index a new bean, its class's fields must be annotated with Field
for Solr to know which fields to index.
To update all the fields of a document in Solr, the new bean must be created with the ID of the existing document. With this, the one-liner will replace the existing document entirely with the new bean's data.
To partially update a Solr document, one must create a SolrInputDocument
and populate the fields using Solr's mechanism for updating Solr fields.
For example, assume the following document exists in the core:
{ "id": "230498302", "price": 10, "popularity": 42, "categories": [ "kids" ], "promo_ids": [ "a123x" ], "tags": [ "free_to_try", "buy_now", "clearance", "on_sale" ] }In order to update only the
price
field,
the caller should pass the following SolrInputDocument
to this one-liner:
SolrInputDocument document = new SolrInputDocument(); document.setField( "id", "230498302" ) Mapmodifier = new HashMap<>(); modifier.put( "set", 500 ); document.setField( "price", modifier );
coreName
- the name of the Solr core where the document will belongpackageName
- the name of the package where the Solr core resides;
if empty, this will assume the name of the package where the service is invokedbean
- the bean to indexIOException
- if there is a communication error within the serverSolrServerException
- if there is an error on the server@GloopObjectParameter(value="output{\nupdateResponse#io.toro.martini.solr.UpdateResponse{\n }\n}") public static GloopModel writeToIndex(@GloopParameter(allowNull=false) String coreName, String packageName, @GloopParameter(allowNull=false) GloopModel gloopModel) throws IOException, SolrServerException
Index a document. This one-liner allows the caller to add a new document or update an existing one, depending on the provided arguments.
Solr will rely on the Solr core's configured schema to identify which properties of the model to index.
When updating a document, updates are partial. Only provided fields will be indexed.
This one-liner also works with Gloop models with FieldModifier
properties.
FieldModifier
properties mirror Solr's modifier argument for SolrInputDocument
s.
coreName
- the name of the Solr core where the document will belongpackageName
- the name of the package where the Solr core resides;
if empty, this will assume the name of the package where the service is invokedgloopModel
- the model to indexIOException
- if there is a communication error within the serverSolrServerException
- if there is an error on the serverpublic static QueryResponse query(String coreName, String packageName, Map<String,String> solrParams)
coreName
- the name of the Solr core which will receive the querypackageName
- the name of the package where the Solr core resides;
if empty, this will assume the name of the package where the service is invokedsolrParams
- Solr query parameters@GloopObjectParameter(value="output{\nqueryResponse#io.toro.martini.solr.QueryResponse{\n }\n}") public static GloopModel query(@GloopParameter(allowNull=false) String coreName, String packageName, @GloopParameter(allowExtraProperties=false) @GloopObjectParameter(value="solrParams[]{\n paramKey\n paramValue\n}") List<GloopModel> solrParams)
coreName
- the name of the Solr core which will receive the querypackageName
- the name of the package where the Solr core resides;
if empty, this will assume the name of the package where the service is invokedsolrParams
- Solr query parameters@GloopObjectParameter(value="output{\nfieldValueFacet#io.toro.martini.solr.Facet{\n }\n}") public static GloopModel fieldValueFacetSearch(@GloopParameter(allowNull=false) String coreName, String packageName, @GloopParameter(allowNull=false) String fieldName, @GloopParameter(allowExtraProperties=false) @GloopObjectParameter(value="solrParams[]{\n paramKey\n paramValue\n}") List<GloopModel> solrParams)
Perform a faceted search for a specific field.
Results include the unique values found for the specified field, and the total number of documents where each value is found.
coreName
- the name of the Solr core which will receive the querypackageName
- the name of the package where the Solr core resides;
if empty, this will assume the name of the package where the service is invokedsolrParams
- Solr query parametersfieldName
- the name of the field that should be treated as a facetpublic static io.toro.martini.solr.Facet fieldValueFacetSearch(String coreName, String packageName, String fieldName, Map<String,Collection<String>> solrParams)
Perform a faceted search for a specific field.
Results include the unique values found for the specified field, and the total number of documents where each value is found.
coreName
- the name of the Solr core which will receive the querypackageName
- the name of the package where the Solr core resides;
if empty, this will assume the name of the package where the service is invokedsolrParams
- Solr query parametersfieldName
- the name of the field that should be treated as a facetpublic static List<io.toro.martini.solr.Facet> multiFieldValueFacetSearch(String coreName, String packageName, Map<String,Collection<String>> solrParams)
Perform a faceted search for a specific set of fields.
Results include the unique values found for each field, and the total number of documents where each value is found.
coreName
- the name of the Solr core which will receive the querypackageName
- the name of the package where the Solr core resides;
if empty, this will assume the name of the package where the service is invokedsolrParams
- Solr query parameters; should have at least one facet.field
parameter@GloopObjectParameter(value="output{\nfieldValueFacet#io.toro.martini.solr.Facet[]{\n }\n}") public static GloopModel multiFieldValueFacetSearch(@GloopParameter(allowNull=false) String coreName, String packageName, @GloopParameter(allowExtraProperties=false) @GloopObjectParameter(value="solrParams[]{\n paramKey\n paramValue\n}") List<GloopModel> solrParams)
Perform a faceted search for a specific set of fields.
Results include the unique values found for each field, and the total number of documents where each value is found.
coreName
- the name of the Solr core which will receive the querypackageName
- the name of the package where the Solr core resides;
if empty, this will assume the name of the package where the service is invokedsolrParams
- Solr query parameters; should have at least one facet.field
parameterpublic static <B,G> io.toro.martini.solr.RangeFacet<B,G> rangeFacetSearch(String coreName, String packageName, String fieldName, Map<String,Collection<String>> solrParams)
Perform a range faceted search for a specific field.
Results include the values found for the field within the specified range, and the total number of documents where each value is found.
B
- data type for the lower and upper bound of the rangesG
- data type for gapcoreName
- the name of the Solr core which will receive the querypackageName
- the name of the package where the Solr core resides;
if empty, this will assume the name of the package where the service is invokedfieldName
- the name of the field that should be treated as a facetsolrParams
- Solr query parameters@GloopObjectParameter(value="output{\nrangeFacet#io.toro.martini.solr.FacetRange{\n }\n}") public static GloopModel rangeFacetSearch(@GloopParameter(allowNull=false) String coreName, String packageName, @GloopParameter(allowNull=false) String fieldName, @GloopParameter(allowExtraProperties=false) @GloopObjectParameter(value="solrParams[]{\n paramKey\n paramValue\n}") List<GloopModel> solrParams)
Perform a range faceted search for a specific field.
Results include the values found for the field within the specified range, and the total number of documents where each value is found.
coreName
- the name of the Solr core which will receive the querypackageName
- the name of the package where the Solr core resides;
if empty, this will assume the name of the package where the service is invokedfieldName
- the name of the field that should be treated as a facetsolrParams
- Solr query parameterspublic static io.toro.martini.solr.PivotFacet pivotFacetSearch(String coreName, String packageName, String fieldName, Map<String,Collection<String>> solrParams)
Perform a pivot faceted search for a specific field.
Results include the values found for each pivot field, and the total number of documents where each value is found.
coreName
- the name of the Solr core which will receive the querypackageName
- the name of the package where the Solr core resides;
if empty, this will assume the name of the package where the service is invokedfieldName
- the name of the field that should be treated as a facetsolrParams
- Solr query parameters@GloopObjectParameter(value="output{\npivotFacet#io.toro.martini.solr.PivotField{\n }\n}") public static GloopModel pivotFacetSearch(@GloopParameter(allowNull=false) String coreName, String packageName, @GloopParameter(allowNull=false) String fieldName, @GloopParameter(allowExtraProperties=false) @GloopObjectParameter(value="solrParams[]{\n paramKey\n paramValue\n}") List<GloopModel> solrParams)
Perform a pivot faceted search for a specific field.
Results include the values found for each pivot field, and the total number of documents where each value is found.
coreName
- the name of the Solr core which will receive the querypackageName
- the name of the package where the Solr core resides;
if empty, this will assume the name of the package where the service is invokedfieldName
- the name of the field that should be treated as a facetsolrParams
- Solr query parameterspublic static List<io.toro.martini.solr.PivotFacet> multiPivotFacetSearch(String coreName, String packageName, Map<String,Collection<String>> solrParams)
Perform a multi pivot faceted search.
Results include the values found for each pivot field, and the total number of documents where each value is found.
coreName
- the name of the Solr core which will receive the querypackageName
- the name of the package where the Solr core resides;
if empty, this will assume the name of the package where the service is invokedsolrParams
- Solr query parameters; should have at least one facet.pivot
parameter@GloopObjectParameter(value="output{\npivotFacet#io.toro.martini.solr.PivotField[]{\n }\n}") public static GloopModel multiPivotFacetSearch(@GloopParameter(allowNull=false) String coreName, String packageName, @GloopParameter(allowExtraProperties=false) @GloopObjectParameter(value="solrParams[]{\n paramKey\n paramValue\n}") List<GloopModel> solrParams)
Perform a multi pivot faceted search.
Results include the values found for each pivot field, and the total number of documents where each value is found.
coreName
- the name of the Solr core which will receive the querypackageName
- the name of the package where the Solr core resides;
if empty, this will assume the name of the package where the service is invokedsolrParams
- Solr query parameters; should have at least one facet.pivot
parameterpublic static io.toro.martini.solr.Stats fieldStatisticsSearch(String coreName, String packageName, String fieldName, Map<String,Collection<String>> solrParams)
Generate statistics for a certain field.
coreName
- the name of the Solr core which will receive the querypackageName
- the name of the package where the Solr core resides;
if empty, this will assume the name of the package where the service is invokedfieldName
- the field for which statistics should be generatedsolrParams
- Solr query parameters@GloopObjectParameter(value="output{\nstats#io.toro.martini.solr.FieldStatsInfo{\n }\n}") public static GloopModel fieldStatisticsSearch(@GloopParameter(allowNull=false) String coreName, String packageName, @GloopParameter(allowNull=false) String fieldName, @GloopParameter(allowExtraProperties=false) @GloopObjectParameter(value="solrParams[]{\n paramKey\n paramValue\n}") List<GloopModel> solrParams)
Generate statistics for a certain field.
coreName
- the name of the Solr core which will receive the querypackageName
- the name of the package where the Solr core resides;
if empty, this will assume the name of the package where the service is invokedfieldName
- the field for which statistics should be generatedsolrParams
- Solr query parameterspublic static List<io.toro.martini.solr.Stats> multiFieldStatisticsSearch(String coreName, String packageName, Map<String,Collection<String>> solrParams)
Generate statistics for one or more fields.
coreName
- the name of the Solr core which will receive the querypackageName
- the name of the package where the Solr core resides;
if empty, this will assume the name of the package where the service is invokedsolrParams
- Solr query parameters@GloopObjectParameter(value="output{\nstats#io.toro.martini.solr.FieldStatsInfo[]{\n }\n}") public static GloopModel multiFieldStatisticsSearch(@GloopParameter(allowNull=false) String coreName, String packageName, @GloopParameter(allowExtraProperties=false) @GloopObjectParameter(value="solrParams[]{\n paramKey\n paramValue\n}") List<GloopModel> solrParams)
Generate statistics for one or more fields.
coreName
- the name of the Solr core which will receive the querypackageName
- the name of the package where the Solr core resides;
if empty, this will assume the name of the package where the service is invokedsolrParams
- Solr query parameters@GloopObjectParameter(value="output{\nqueryResponse#io.toro.martini.solr.QueryResponse{\n }\n}") public static GloopModel searchCore(@GloopParameter(defaultValue="*:*") String query, @GloopParameter(allowNull=false) String coreName, String packageName, String sortField, @GloopParameter(choices={"Ascending","Descending"},defaultValue="Ascending") String sortType, List<String> fields, @GloopParameter(defaultValue="10",allowNull=false) int pageSize, @GloopParameter(defaultValue="1",allowNull=false) int page)
query
- the search querycoreName
- the name of the Solr core which will receive the query
if empty, this will assume that all records are being queriedpackageName
- the name of the package where the Solr core resides;
if empty, this will assume the name of the package where the service is invokedsortField
- the field which the sorting will be based onsortType
- the order in which the results are givenfields
- the list of fields to include in the response
if empty, this will include all fieldspageSize
- the number of results to display in a pagepage
- the page number of results to displaypublic static io.toro.martini.solr.MartiniSolrClient solr(String coreName) throws ToroException
Get the SolrClient
of a named Solr core, belonging to the package in the current context.
Example usage:
def solr = 'media_store'.solr() def query = new SolrQuery( 'q=video&sort=price desc' ) def queryResult = solr.query( query )
coreName
- the name of the Solr coreSolrClient
ToroException
public static GloopCursor insertMany(@GloopParameter(allowNull=false) String coreName, String packageName, @GloopParameter(allowNull=false,defaultValue="On Close",choices={"Never","Batch","On Close"}) String commitMode, @GloopParameter(allowNull=false,defaultValue="false") boolean closeClient, GloopExecutionContext context)
SolrInputDocument
,
allowing Gloop to write models to Solr.coreName
- the name of the Solr core where the document will belongpackageName
- the name of the package where the Solr core resides;
if empty, this will assume the name of the package where the service is invokedcommitMode
- tells the cursor when to commit the cached documents; possible values are:
closeClient
- boolean value indicating whether or not the cursor will close the client
after it has been exhaustedcontext
- the Gloop execution context (automatically mapped by Gloop)public static GloopCursor insertMany(@GloopParameter(allowNull=false) String coreName, String packageName, @GloopParameter(allowNull=false,defaultValue="On Close",choices={"Never","Batch","On Close"}) String commitMode, @GloopParameter(allowNull=false,defaultValue="false") boolean closeClient, @GloopParameter(allowNull=false,defaultValue="1000") int batchSize, GloopExecutionContext context)
SolrInputDocument
,
allowing Gloop to write models to Solr.coreName
- the name of the Solr core where the document will belongpackageName
- the name of the package where the Solr core resides;
if empty, this will assume the name of the package where the service is invokedcommitMode
- tells the cursor when to commit the cached documents; possible values are:
closeClient
- boolean value indicating whether or not the cursor will close the client
after it has been exhaustedbatchSize
- how many written models to cache before sending them to Solrcontext
- the Gloop execution context (automatically mapped by Gloop)Copyright © 2023. All rights reserved.