Open topic with navigation

# Create a Question Equivalence Class and Add an Answer

A question equivalence class is a group of equivalent questions. When you have multiple questions with different wording that request the same information, you can combine these questions in a question equivalence class. You also use the question equivalence class to add an answer.

The question equivalence class contains the following information:

- the reference question (a standard question that is the most representative question for the answer).
- the answer to the reference question.
- a list of real, sample questions that are equivalent to the reference question. These questions are stored by adding a question. See Add a Question.
- a question equivalence rule that matches the equivalence question. When a user asks a question, Answer Server uses the question equivalence rule to find a relevant question equivalence class to match. See Question Equivalence Rules.

To create question equivalence classes, you use a `ManageResources` action in a POST request method, with the information about the questions provided in the `Data` parameter as a JSON object.

NOTE:

When you add a question to a question equivalence class, Answer Server automatically updates the question state to `answered`. You cannot delete a question in this state, and you cannot manually move the question out of this state. You must remove the question from the question equivalence class. See Update a Question Equivalence Class.

You must include the `question_id` values for the questions that you want to include in the question equivalence class. You can retrieve the `question_id` values by sending a `GetResources` action. For example:

    http://localhost:12000?Action=GetResources&SystemName=Answerbank&Type=question

You can add multiple question equivalence classes in the same operation, where each question equivalence class is an object in an array.

The following example adds a single question equivalence class that combines two questions, and adds a reference question and an answer. You can also add optional metadata for the answer, such as author information.

    Action=ManageResources&SystemName=AnswerBank
    data={
       "operation":"add",
       "type":"question_equivalence_class",
       "question_equivalence_classes":[
          {
             "question_ids":[
                "9706856188043740111",
                "8129920660480699726"
             ],
             "rule":{"text":"how AND (regular NEAR2 updates) AND MyCompany"},
             "answer":{
                "text":"Send an email to subscribe@example.com, and we'll add you to our monthly newsletter.",
                "metadata":[
                   {"key":"author", "value":"Alex"},
                   {"key":"modified_date", "value":"2017-05-05"}
                ]
             },
             "reference_question":"How do I get regular updates about MyCompany?"
          }
       ]
    }

NOTE:

Metadata key names can contain alphanumeric characters (a-z, 0-9), period (.), underscore (_) and hyphen (-). They cannot start with a number. It is also best practice to use field names that conform to XML specifications.

You can retrieve the full schema for the JSON object to use by using the `GetResources` action. See Find the JSON Schema for Your Update.

NOTE:

The `ManageResources` action fails if you attempt to use request JSON that contains properties that are not contained in the appropriate schema.

You can also use the `GetResources` action to generate a rule for your question equivalence class. See Generate a Question Equivalence Rule.

© 2015-2018 EntIT Software LLC, a Micro Focus company | Send documentation feedback to Micro Focus Close Send documentation feedback To open the configured email client on this computer, open an email window. Otherwise, copy the information below to a web mail client, and send this email to swpdl.idoldocsfeedback@microfocus.com. We appreciate your feedback! Product: Topic Title: Help Topic: Feedback:

_FT_HTML5_bannerTitle.htm