/*
 * Copyright (C) 2024 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

syntax = "proto2";

package android.appsearch;

option java_outer_classname = "AppSearchProtoEnums";
option java_multiple_files = true;

/**
 * The enum class of AppSearch query correction type compared with the previous query.
 *
 * It is used to tag the transition type between adjacent query pairs in the search intent sequence
 * within a single search session.
 *
 * For example, the user has 4 search intents with queries "a" -> "app" -> "apple" -> "pear". Then
 * there will be 5 transitions:
 *     ("", "a"), ("a", "app"), ("app" -> "apple"), ("apple", "pear"), ("pear", "")
 * AppSearch will analyze each pair and tag the query correction type.
 *
 * Next tag: 5
 */
enum QueryCorrectionType {
    UNKNOWN = 0;

    // Indicates that the current query is the 1st query and there is no previous
    // query.
    FIRST_QUERY = 1;

    // Indicates that the current query is refined (slightly adjustment, e.g. adding new
    // characters, fixing typo) from the previous query.
    REFINEMENT = 2;

    // Indicates that the previous query is considered abandoned and the user
    // starts over the search with a different query.
    ABANDONMENT = 3;

    // Indicates that the user ends the search session with this search query.
    //
    // Whether it is a good or bad end session (i.e. the user is satisfied with the returned
    // document(s) or not when ending the session) can be determined by other atom fields, e.g.
    // num_good_clicks, clicks_time_stay_on_result_millis.
    END_SESSION = 4;
}
