1/*
2 * Copyright (C) 2024 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 *      http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17syntax = "proto2";
18
19package android.appsearch;
20
21option java_outer_classname = "AppSearchProtoEnums";
22option java_multiple_files = true;
23
24/**
25 * The enum class of AppSearch query correction type compared with the previous query.
26 *
27 * It is used to tag the transition type between adjacent query pairs in the search intent sequence
28 * within a single search session.
29 *
30 * For example, the user has 4 search intents with queries "a" -> "app" -> "apple" -> "pear". Then
31 * there will be 5 transitions:
32 *     ("", "a"), ("a", "app"), ("app" -> "apple"), ("apple", "pear"), ("pear", "")
33 * AppSearch will analyze each pair and tag the query correction type.
34 *
35 * Next tag: 5
36 */
37enum QueryCorrectionType {
38    UNKNOWN = 0;
39
40    // Indicates that the current query is the 1st query and there is no previous
41    // query.
42    FIRST_QUERY = 1;
43
44    // Indicates that the current query is refined (slightly adjustment, e.g. adding new
45    // characters, fixing typo) from the previous query.
46    REFINEMENT = 2;
47
48    // Indicates that the previous query is considered abandoned and the user
49    // starts over the search with a different query.
50    ABANDONMENT = 3;
51
52    // Indicates that the user ends the search session with this search query.
53    //
54    // Whether it is a good or bad end session (i.e. the user is satisfied with the returned
55    // document(s) or not when ending the session) can be determined by other atom fields, e.g.
56    // num_good_clicks, clicks_time_stay_on_result_millis.
57    END_SESSION = 4;
58}
59