Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
D
Distributed-Search-Engine
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
tammam.alsoleman
Distributed-Search-Engine
Commits
b5da3f26
Commit
b5da3f26
authored
Jan 14, 2026
by
tammam.alsoleman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
create Proto File
parent
24affe20
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
48 additions
and
0 deletions
+48
-0
search.proto
src/main/proto/search.proto
+48
-0
No files found.
src/main/proto/search.proto
View file @
b5da3f26
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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment