Add single-query search using the optimised model - #12
Merged
Merged
Conversation
- Introduced `search.hpp` with definitions for query handling, search options, and search reports. - Implemented `Searcher` class for executing searches against a record store. - Added `QueryField` and `QueryRecord` structures to represent search queries. - Implemented `ParseQueryField` function for parsing query strings. - Added `SearchOptions` and `SearchReport` structures to manage search configurations and results. - Implemented `PrintSearchReport` and `SearchReportJson` functions for reporting search results. - Added `GroupHitsByCluster` function to label search hits by their respective clusters. - Extended `SignatureTable` in `signature.cpp` to accommodate dynamic dictionary sizes. - Created comprehensive unit tests for search functionality in `search_test.cpp`, covering various scenarios and edge cases.
A common exact name could rank below a typo of it, because only the exact level was term-frequency adjusted. `cpplink search` gains --fuzzy-tf and --ball-budget, and `Linker.search` takes tf_damping and fuzzy_tf. Search measures the query's own neighbourhood mass from the dictionary walk and pins it on the scorer, so an adopted value is adjusted too (it read past the end of the table before) and a stored value scores what predict would. The mass is clamped to the table's range to keep the bracket admissible. Neighbourhood tables are built only for the comparisons the query names and the Python session keeps them. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
search_test.cpp used std::log2 without including <cmath>, which libc++ provides transitively and libstdc++ does not. Check(f(&error), "stage: " + error) left the order of its two arguments to the compiler, and MSVC built the message before f had written the error, so the Python binding raised 'search: ' with no reason. A Check overload taking the prefix separately defers the concatenation until after the call; the five search, rescore and simplify sites use it.
4ment
added a commit
that referenced
this pull request
Sep 28, 2026
Add search functionality and related structures - Introduced `search.hpp` with definitions for query handling, search options, and search reports. - Implemented `Searcher` class for executing searches against a record store. - Added `QueryField` and `QueryRecord` structures to represent search queries. - Implemented `ParseQueryField` function for parsing query strings. - Added `SearchOptions` and `SearchReport` structures to manage search configurations and results. - Implemented `PrintSearchReport` and `SearchReportJson` functions for reporting search results. - Added `GroupHitsByCluster` function to label search hits by their respective clusters. - Extended `SignatureTable` in `signature.cpp` to accommodate dynamic dictionary sizes. - Created comprehensive unit tests for search functionality in `search_test.cpp`, covering various scenarios and edge cases.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implement single-query search using the optimised entity-linkage model.
Given a query record, the search uses the fitted model to identify and rank the most likely matching records in the reference dataset.
Changes
Testing