Commit b5da3f26 authored by tammam.alsoleman's avatar tammam.alsoleman

create Proto File

parent 24affe20
syntax = "proto3";
option java_multiple_files = true;
package com.distributed.search.model;
// The search service definition.
service SearchService {
// Phase 1: Coordinator requests document statistics from workers.
// This is used to calculate the Global Inverse Document Frequency (IDF).
rpc GetDocumentStats (StatRequest) returns (StatResponse);
// Phase 2: Coordinator sends Global IDF to workers and requests
// the final TF-IDF scores for a specific set of documents.
rpc GetFinalScores (CalculationRequest) returns (SearchResponse);
}
// Request containing the query terms and the list of documents assigned to a worker.
message StatRequest {
repeated string terms = 1; // Words the user is searching for
int32 start_index = 2;
int32 count = 3;
}
// Response containing the local frequency of terms across the worker's documents.
message StatResponse {
// Key: Search term, Value: Number of documents containing this term locally
map<string, int32> term_to_document_count = 1;
}
// Request sent after the Coordinator calculates the Global IDF for each term.
message CalculationRequest {
repeated string terms = 1;
map<string, double> global_idfs = 2; // Key: Search term, Value: Calculated Global IDF
int32 start_index = 3;
int32 count = 4;
}
// Response containing the final calculated scores for each document.
message SearchResponse {
message DocumentResult {
string document_name = 1;
double score = 2;
}
// A list of document names and their corresponding TF-IDF scores
repeated DocumentResult results = 1;
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment