package NWebmaster.NCatalogia.NProto;

import "mapreduce/yt/interface/protos/extension.proto";

message TDssmEmbeddings {
    repeated float Ctr              = 1;
    repeated float CtrNoMiner       = 2;
    repeated float Uta              = 3;
    repeated float XfOneSE          = 4;
    repeated float CentroidXfOneSE  = 5;
}

message TDocStatistics {
    optional float L2ToCentroidMean     = 1;
    optional float L2ToCentroidSigma    = 2;
    optional uint64 UniqQueries         = 3;
    optional uint64 Queries             = 4;
}

message TWordstat {
    optional string Query       = 1 [(NYT.column_name) = "Query"];
    optional int64 Timestamp    = 2 [(NYT.column_name) = "Timestamp"];
    optional uint64 RegionId    = 3 [(NYT.column_name) = "RegionId"];
    optional uint64 Wordstat    = 4 [(NYT.column_name) = "Wordstat"];
    optional uint64 Position    = 5 [(NYT.column_name) = "Position"];
}

message THits {
    optional string Query           = 1 [(NYT.column_name) = "Query"];
    optional uint64 QueryId         = 2 [(NYT.column_name) = "QueryId"];
    optional uint64 Hits            = 3 [(NYT.column_name) = "Hits"];
}

message TQuery {
    optional string Query           = 1 [(NYT.column_name) = "Query"];
    optional string Host            = 2 [(NYT.column_name) = "Host"];
    optional string Path            = 3 [(NYT.column_name) = "Path"];
    optional string UrlUTA          = 4 [(NYT.column_name) = "UrlUTA"];
    optional string NormalizedQuery = 5 [(NYT.column_name) = "NormalizedQuery"];
    optional string NormalizedTitle = 6 [(NYT.column_name) = "NormalizedTitle"];
    optional uint64 QueryId         = 7 [(NYT.column_name) = "QueryId"];
    optional uint64 UrlId           = 8 [(NYT.column_name) = "UrlId"];
    optional uint64 OwnerId         = 9 [(NYT.column_name) = "OwnerId"];
    optional uint64 RegionId        = 10 [(NYT.column_name) = "RegionId"];
    optional uint64 OwnersPerQuery  = 11 [(NYT.column_name) = "OwnersPerQuery"];
    optional uint64 OQClicks        = 12 [(NYT.column_name) = "OQClicks"];
    optional uint64 OQShows         = 13 [(NYT.column_name) = "OQShows"];
    optional uint64 OQRClicks       = 14 [(NYT.column_name) = "OQRClicks"];
    optional uint64 OQRShows        = 15 [(NYT.column_name) = "OQRShows"];
    optional uint64 QClicks         = 16 [(NYT.column_name) = "QClicks"];
    optional uint64 QShows          = 17 [(NYT.column_name) = "QShows"];
    optional uint64 QRClicks        = 18 [(NYT.column_name) = "QRClicks"];
    optional uint64 QRShows         = 19 [(NYT.column_name) = "QRShows"];
    optional uint64 QRUClicks       = 20 [(NYT.column_name) = "QRUClicks"];
    optional uint64 QRUShows        = 21 [(NYT.column_name) = "QRUShows"];
    optional uint64 QUClicks        = 22 [(NYT.column_name) = "QUClicks"];
    optional uint64 QUShows         = 23 [(NYT.column_name) = "QUShows"];
    optional uint64 UClicks         = 24 [(NYT.column_name) = "UClicks"];
    optional uint64 UShows          = 25 [(NYT.column_name) = "UShows"];
    optional uint64 Hits            = 26 [(NYT.column_name) = "Hits"];
    optional uint32 EditDistance    = 27 [(NYT.column_name) = "EditDistance"];
    optional uint32 WordCount                       = 28 [(NYT.column_name) = "WordCount"];
    optional TDssmEmbeddings DssmQueryEmbeddings    = 29 [(NYT.column_name) = "DssmQueryEmbeddings"];
    optional TDssmEmbeddings DssmDocEmbeddings      = 30 [(NYT.column_name) = "DssmDocEmbeddings"];
    optional TDocStatistics DocStatistics           = 31 [(NYT.column_name) = "DocStatistics"];
    optional int32 UpperPornoUpperPl                = 32 [(NYT.column_name) = "UpperPornoUpperPl"];
    optional string CorrectedQuery                  = 33 [(NYT.column_name) = "CorrectedQuery"];
    optional bool IsCorrectedQuery                  = 34 [(NYT.column_name) = "IsCorrectedQuery"];
}

message TQueryInfo {
    optional uint64 QueryId                         = 1 [(NYT.column_name) = "QueryId"];
    optional uint64 Owners                          = 2 [(NYT.column_name) = "Owners"];
    optional string Query                           = 3 [(NYT.column_name) = "Query"];
    optional string NormalizedQuery                 = 4 [(NYT.column_name) = "NormalizedQuery"];
    optional uint64 RegionId                        = 5 [(NYT.column_name) = "RegionId"];
    optional string OwnersUrls                      = 6 [(NYT.column_name) = "OwnersUrls"];
    optional TCounters QCounters                    = 7 [(NYT.column_name) = "QCounters"];
    optional TOwnerCounters OQCounters              = 8 [(NYT.column_name) = "OQCounters"];
    optional TOwnerRegionCounters OQRCounters       = 9 [(NYT.column_name) = "OQRCounters"];
    optional TRegionCounters QRCounters             = 10 [(NYT.column_name) = "QRCounters"];
    optional TUrlCounters QRUCounters               = 11 [(NYT.column_name) = "QRUCounters"];
    optional TUrlCounters QUCounters                = 12 [(NYT.column_name) = "QUCounters"];
    optional TUrlCounters UCounters                 = 13 [(NYT.column_name) = "UCounters"];
    optional uint64 Hits                            = 14 [(NYT.column_name) = "Hits"];
    optional uint32 EditDistance                    = 15 [(NYT.column_name) = "EditDistance"];
    optional uint32 WordCount                       = 16 [(NYT.column_name) = "WordCount"];
    optional TDssmEmbeddings DssmQueryEmbeddings    = 17 [(NYT.column_name) = "DssmQueryEmbeddings"];
    optional int32 UpperPornoUpperPl                = 18 [(NYT.column_name) = "UpperPornoUpperPl"];
    optional string CorrectedQuery                  = 19 [(NYT.column_name) = "CorrectedQuery"];
    optional bool IsCorrectedQuery                  = 20 [(NYT.column_name) = "IsCorrectedQuery"];
}

message TUrlInfo {
    optional uint64 UrlId                           = 1 [(NYT.column_name) = "UrlId"];
    optional uint64 RegionId                        = 2 [(NYT.column_name) = "RegionId"];
    optional string Host                            = 3 [(NYT.column_name) = "Host"];
    optional string Path                            = 4 [(NYT.column_name) = "Path"];
    optional string UrlUTA                          = 5 [(NYT.column_name) = "UrlUTA"];
    optional string NormalizedTitle                 = 6 [(NYT.column_name) = "NormalizedTitle"];
    optional string QueriesPerUrl                   = 7 [(NYT.column_name) = "QueriesPerUrl"];
    optional TCounters UCounters                    = 8 [(NYT.column_name) = "UCounters"];
    optional TDssmEmbeddings DssmDocEmbeddings      = 9 [(NYT.column_name) = "DssmDocEmbeddings"];
    optional TDocStatistics DocStatistics           = 10 [(NYT.column_name) = "DocStatistics"];
}

message TOwnerInfo {
    optional string Host            = 1 [(NYT.column_name) = "Host"];
    optional string Owner           = 2 [(NYT.column_name) = "Owner"];
    optional uint64 OwnerId         = 3 [(NYT.column_name) = "OwnerId"];
}

message TQueryRegionUrlInfo {
    optional uint64 QueryId     = 1 [(NYT.column_name) = "QueryId"];
    optional uint64 RegionId    = 2 [(NYT.column_name) = "RegionId"];
    optional uint64 UrlId       = 3 [(NYT.column_name) = "UrlId"];
    optional string OwnersUrls  = 4 [(NYT.column_name) = "OwnersUrls"];
}

message TForeignQuery {
    optional uint64 OwnerId             = 1 [(NYT.column_name) = "OwnerId"];
    optional uint64 QueryId             = 2 [(NYT.column_name) = "QueryId"];
    optional uint64 RegionId            = 3 [(NYT.column_name) = "RegionId"];
    optional uint64 UrlId               = 4 [(NYT.column_name) = "UrlId"];
    optional uint64 BranchHostId        = 5 [(NYT.column_name) = "BranchHostId"];
    optional uint64 QueriesMultiplier   = 6 [(NYT.column_name) = "QueriesMultiplier"];
    optional uint64 UrlsMultiplier      = 7 [(NYT.column_name) = "UrlsMultiplier"];
    optional uint64 BranchUrlsCount     = 8 [(NYT.column_name) = "BranchUrlsCount"];
}

message TForeignQueryCounter {
    optional uint64 UrlId               = 1 [(NYT.column_name) = "UrlId"];
    optional uint64 RegionId            = 2 [(NYT.column_name) = "RegionId"];
    optional uint64 QueriesMultiplier   = 3 [(NYT.column_name) = "QueriesMultiplier"];
    optional uint64 UrlsMultiplier      = 4 [(NYT.column_name) = "UrlsMultiplier"];
}

message TForeignUrl {
    optional uint64 OwnerId             = 1 [(NYT.column_name) = "OwnerId"];
    optional uint64 QueryId             = 2 [(NYT.column_name) = "QueryId"];
    optional uint64 RegionId            = 3 [(NYT.column_name) = "RegionId"];
    optional uint64 UrlId               = 4 [(NYT.column_name) = "UrlId"];
    optional uint64 QueriesCount        = 6 [(NYT.column_name) = "QueriesCount"];
    optional uint64 BranchUrlId         = 7 [(NYT.column_name) = "BranchUrlId"];
    optional uint64 BranchQueriesCount  = 8 [(NYT.column_name) = "BranchQueriesCount"];
}

message TForeignUrlCounter {
    optional uint64 QueryId             = 1 [(NYT.column_name) = "QueryId"];
}

message TGeneratedQuery {
    optional uint64 QueryId             = 1 [(NYT.column_name) = "QueryId"];
    optional uint64 RegionId            = 2 [(NYT.column_name) = "RegionId"];
    optional uint64 UrlId               = 3 [(NYT.column_name) = "UrlId"];
    optional string Query               = 4 [(NYT.column_name) = "Query"];
    optional string NormalizedQuery     = 5 [(NYT.column_name) = "NormalizedQuery"];
    optional string NormalizedTitle     = 6 [(NYT.column_name) = "NormalizedTitle"];
    optional string Owner               = 7 [(NYT.column_name) = "Owner"];
    optional string Host                = 8 [(NYT.column_name) = "Host"];
    optional string Path                = 9 [(NYT.column_name) = "Path"];
    optional string UrlUTA              = 10 [(NYT.column_name) = "UrlUTA"];
    optional uint64 Owners              = 11 [(NYT.column_name) = "Owners"];
    optional uint64 Hits                = 12 [(NYT.column_name) = "Hits"];
    optional uint32 EditDistance        = 13 [(NYT.column_name) = "EditDistance"];
    optional uint32 WordCount           = 14 [(NYT.column_name) = "WordCount"];
    optional uint64 QueriesMultiplier   = 15 [(NYT.column_name) = "QueriesMultiplier"];
    optional uint64 UrlsMultiplier      = 16 [(NYT.column_name) = "UrlsMultiplier"];
    optional uint64 BranchUrlsCount     = 17 [(NYT.column_name) = "BranchUrlsCount"];
    optional uint64 OQClicks            = 18 [(NYT.column_name) = "OQClicks"];
    optional uint64 OQShows             = 19 [(NYT.column_name) = "OQShows"];
    optional uint64 OQRClicks           = 20 [(NYT.column_name) = "OQRClicks"];
    optional uint64 OQRShows            = 21 [(NYT.column_name) = "OQRShows"];
    optional uint64 QClicks             = 22 [(NYT.column_name) = "QClicks"];
    optional uint64 QShows              = 23 [(NYT.column_name) = "QShows"];
    optional uint64 QRClicks            = 24 [(NYT.column_name) = "QRClicks"];
    optional uint64 QRShows             = 25 [(NYT.column_name) = "QRShows"];
    optional uint64 QRUClicks           = 26 [(NYT.column_name) = "QRUClicks"];
    optional uint64 QRUShows            = 27 [(NYT.column_name) = "QRUShows"];
    optional uint64 QUClicks            = 28 [(NYT.column_name) = "QUClicks"];
    optional uint64 QUShows             = 29 [(NYT.column_name) = "QUShows"];
    optional uint64 UClicks             = 30 [(NYT.column_name) = "UClicks"];
    optional uint64 UShows              = 31 [(NYT.column_name) = "UShows"];
    optional double DssmCtr             = 32 [(NYT.column_name) = "DssmCtr"];
    optional double DssmCtrNoMiner      = 33 [(NYT.column_name) = "DssmCtrNoMiner"];
    optional double DssmUta             = 34 [(NYT.column_name) = "DssmUta"];
    optional double DssmTopL2           = 35 [(NYT.column_name) = "DssmTopL2"];
    optional TDssmEmbeddings DssmQueryEmbeddings    = 36 [(NYT.column_name) = "DssmQueryEmbeddings"];
    optional double L2ToCentroid                    = 37 [(NYT.column_name) = "L2ToCentroid"];
    optional double L2ToCentroidMean                = 38 [(NYT.column_name) = "L2ToCentroidMean"];
    optional double L2ToCentroidSigma               = 39 [(NYT.column_name) = "L2ToCentroidSigma"];
    optional double L2ToCentroidSigmaDistance       = 40 [(NYT.column_name) = "L2ToCentroidSigmaDistance"];
    optional uint64 UrlOwnUniqQueries               = 41 [(NYT.column_name) = "UrlOwnUniqQueries"];
    optional uint64 UrlOwnQueries                   = 42 [(NYT.column_name) = "UrlOwnQueries"];
    optional int32 UpperPornoUpperPl                = 43 [(NYT.column_name) = "UpperPornoUpperPl"];
    optional bool IsPornoHost                       = 44 [(NYT.column_name) = "IsPornoHost"];
    optional bool IsCorrectedQuery                  = 45 [(NYT.column_name) = "IsCorrectedQuery"];
    optional string CorrectedQuery                  = 46 [(NYT.column_name) = "CorrectedQuery"];
}

message TGeneratedUrl {
    optional uint64 UrlId       = 1 [(NYT.column_name) = "UrlId"];
    optional uint64 RegionId    = 2 [(NYT.column_name) = "RegionId"];
}

message TCounters {
    required uint64 Clicks      = 1;
    required uint64 Shows       = 2;
}

message TOwnerCounter {
    required uint64 OwnerId     = 1;
    required TCounters Counters = 2;
}

message TOwnerRegionCounter {
    required uint64 OwnerId     = 1;
    required uint64 RegionId    = 2;
    required TCounters Counters = 3;
}

message TRegionCounter {
    required uint64 RegionId    = 1;
    required TCounters Counters = 2;
}

message TUrlCounter {
    required uint64 UrlId       = 1;
    required TCounters Counters = 2;
}

message TQueryCounter {
    required uint64 QueryId     = 1;
    required TCounters Counters = 2;
}
/*
message TQueryRegionUrlCounter {
    required uint64 QueryId     = 1;
    required uint64 RegionId    = 2;
    required uint64 UrlId       = 3;
    required TCounters Counters = 4;
}
*/
message TOwnerCounters {
    repeated TOwnerCounter Counters         = 1;
}

message TOwnerRegionCounters {
    repeated TOwnerRegionCounter Counters   = 1;
}

message TRegionCounters {
    repeated TRegionCounter Counters        = 1;
}

message TUrlCounters {
    repeated TUrlCounter Counters           = 1;
}

message TQueryCounters {
    repeated TQueryCounter Counters         = 1;
}

//message TQueryRegionUrlCounters {
//    repeated TQueryRegionUrlCounter Counters    = 1;
//}

message TOwnerFilter {
    optional uint64 QueryId                     = 1 [(NYT.column_name) = "QueryId"];
    optional uint64 Owners                      = 2 [(NYT.column_name) = "Owners"];
    optional TCounters QCounters                = 3 [(NYT.column_name) = "QCounters"];
    optional TOwnerCounters OQCounters          = 4 [(NYT.column_name) = "OQCounters"];
    optional TOwnerRegionCounters OQRCounters   = 5 [(NYT.column_name) = "OQRCounters"];
    optional TRegionCounters QRCounters         = 6 [(NYT.column_name) = "QRCounters"];
    optional TUrlCounters QUCounters            = 7 [(NYT.column_name) = "QUCounters"];
}

message TGeneratedStatistics {
    optional string Host            = 1 [(NYT.column_name) = "Host"];
    optional bool IsPornoHost       = 2 [(NYT.column_name) = "IsPornoHost"];
    optional uint64 PornoQueries    = 3 [(NYT.column_name) = "PornoQueries"];
    optional uint64 TotalQueries    = 4 [(NYT.column_name) = "TotalQueries"];
}
