- Spark Job ID used by the API to reference the job.
- Location where your signals are stored, the Spark-compatible format for the signals, and filters for the query.
- Location where your content catalog is stored and the Spark-compatible format of the catalog data.
- Location and Spark-compatible format of the job output.
- Field names for the query string, the category and item from the catalog, the signals item ID, and the signals count field.
- Style of the text analyzer you want to use for the job.
- Top category proportion in relation to all the categories, and the minimum number of the query category pair counts.
Automatically Classify New Queries
Automatically Classify New Queries
You can predict the categories most likely to satisfy a new query using this workflow:
See the detailed steps below.
This job takes raw text and an associated single class as input. Although it trains on single classes, there is an option to predict the top several classes with their scores.At a minimum, you must configure these:
- Use the Build Training Data job to join your signals data with your catalog data and produce training data in the form of query/class pairs.
- Use the Classification job to train a classification model using the output collection of the Build Training Data job as the training collection.

To predict the categories of new queries
- Navigate to Collections > Jobs > Add+ > Build Training Data to create a new Build Training Data job.
-
Configure the job as follows:
- In the Catalog Path field, enter the collection name or cloud storage path where your main content is stored.
- In the Catalog Format field, enter
solr
if you are analyzing a Solr collection, or another format if your content is in the cloud. - In the Signals Path field, enter the collection name or cloud storage path where your signals data is stored.
- In the Output Path field, enter the collection name or cloud storage path where you want to store the training data.
- In the Category Field in Catalog field, enter the field name for the category data in your main content.
- In the Item ID Field in Catalog field, enter the field name for the item IDs in your main content.
- Check that the values of Item ID Field in Signals and Count Field in Signals match the field names in your signals data.
- Save the job.
- Click Run > Start to run the job.
- Navigate to Collections > Jobs > Add+ > Classification to create a new Classification job.
-
Configure the job as follows:
- In the Model Deployment Name field, enter an ID for the new classification model.
- In the Training Data Path field, enter the collection name or cloud storage path from the Build Training Data job’s Output Path field.
-
In the Training Data Format field, leave the default
solr
value if the Training Data Path is a collection or if you used the default format in your Build Training Data job configuration. If you configured the Build Training Data job to output a different format, enter it here. -
In the Training collection content field, enter
query_s
, the default content field name in the Build Training Data job’s output. -
In the Training collection class field, enter
category_s
, the default category field name in the Build Training Data job’s output.For additional configuration details, see Best practices below.
- Save the job.
- Verify that the Build Training Data job has finished successfully.
- Click Run > Start to run the job.
- Navigate to Indexing > Query Workbench > Load and select your query pipeline.
-
Configure the query pipeline as follows:
- Add a new Machine Learning stage.
- In the Model ID field, enter the name from the Classification job’s Model Deployment Name field.
- In the Model input transformation script field, enter the following:
- In the Model output transformation script field, enter the following:
- Click Apply.
- Save the query pipeline.
Custom output transformation script examples
Best practices for configuring the Classification job
This job analyzes how your existing documents are categorized and produces a classification model that can be used to predict the categories of new documents at index time.In addition to the information in this topic, see Automatically classify new documents at index time for configuration information and examples.Automatically Classify New Documents at Index Time
Automatically Classify New Documents at Index Time
You can predict the categories of new documents at index time by using the Classification job to analyze previously-classified documents in your index and produce a training model, then referencing the model in the Machine Learning index stage.Classification job dataflow (documents)

How to configure new document classification
- Navigate to Collections > Jobs > Add+ > Classification to create a new Classification job.
-
Configure the job as follows:
- In the Model Deployment Name field, enter an ID for the new classification model.
- In the Training Data Path field, enter the collection name or cloud storage path where your main content is stored.
-
In the Training Data Format field, leave the default
solr
value if the Training Data Path is a collection. Otherwise, specify the format of your data in cloud storage. -
In the Training collection content field, enter the name of the field that contains the content to analyze.
The content field that you choose depends on your use case and the types of queries that your users commonly make.
For example, you could choose the description field if users tend to make descriptive queries like “4k TV” or “soft waterproof jacket”.
But if users are more likely to search for specific brands or products, such as “LG TV” or “North Face jacket”, then the product name field might be more suitable. -
In the Training collection class field, enter the name of the field that contains the category data.
For additional configuration details, see Best practices below.
- Save the job.
- Specify the model’s name in the Machine Learning stage of your index pipeline.
-
In the Model input transformation script field, enter the following:
-
In the Model output transformation script field, enter the following:
- Click Apply.
- Save the query pipeline.
Custom output transformation script example
Best practices for configuring the Classification job
This job analyzes how your existing documents are categorized and produces a classification model that can be used to predict the categories of new documents at index time.In addition to the information in this topic, see Automatically classify new queries for configuration information and examples.This job takes raw text and an associated single class as input. Although it trains on single classes, there is an option to predict the top several classes with their scores.At a minimum, you must configure these:- An ID for this job
- A Method; Logistic Regression is the default
- A Model Deployment Name
- The Training Collection
- The Training collection content field, the document field containing the raw text
- The Training collection class field containing the classes, labels, or other category data for the text
- An ID for this job
- A Method; Logistic Regression is the default
- A Model Deployment Name
- The Training Collection
- The Training collection content field, the document field containing the raw text
- The Training collection class field containing the classes, labels, or other category data for the text