Source Code Search Engine Syntax-Based Ranking

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Existing source code search engines rank search results based on keyword frequency, which is less relevant for structured programming languages, leading to unsorted and less relevant search results for developers.

Innovation Solution

A system that generates metadata for source code files, associating each word with its code type based on the programming language's syntax, and uses a ranking engine to weight occurrences by code type and file type boost values, producing a syntax-based ranking order for more relevant search results.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Productivity

If search results are ranked based on keyword frequency, then the ranking process is simple and fast, but the search results are less relevant for structured programming languages

Engineering Contradiction:
Improvesearch result relevanceVSAvoidranking system complexity
Core Design Contradiction:
ProductivityVSDevice complexity

Solution Approach 1:

The patent changes the ranking parameters from simple keyword frequency to a multi-dimensional scoring system that includes code type context (declaration, definition, usage), file type weights, and occurrence patterns. This transforms the ranking mechanism to better suit structured programming languages while maintaining computational feasibility through predefined weightings and systematic evaluation criteria.

Inventive Principle:
Principle #35Parameter changes

Solution Approach 2:

The ranking system is segmented into multiple independent evaluation components: code type identification (declaration/definition/usage), file type classification, occurrence frequency analysis, and contextual positioning. Each segment evaluates specific aspects of code matches independently, then combines results to produce the final ranking, making the complex system manageable and interpretable.

Inventive Principle:
Principle #1Segmentation

2Ease of operation

If search results are unsorted, then the ranking process is simple, but navigating through search results becomes difficult and frustrating

Engineering Contradiction:
Improvesearch result navigationVSAvoidsorting mechanism complexity
Core Design Contradiction:
Ease of operationVSDevice complexity

Solution Approach 1:

The system changes from no sorting to sorting based on multiple parameters including code type relevance, file type importance, occurrence frequency, and contextual position. These parameters are weighted and combined to generate a comprehensive relevance score that automatically orders results, improving navigation without requiring complex user intervention.

Inventive Principle:
Principle #35Parameter changes

Solution Approach 2:

The system performs preliminary ranking and sorting of search results before presentation to the user. By pre-processing results according to established criteria (code type weights, file type priorities, occurrence patterns), the system prepares optimized, relevance-ordered results in advance, making navigation intuitive and reducing user cognitive load during result exploration.

Inventive Principle:
Principle #10Preliminary action

Data Source

PatentUS11809436B2Source code search engine
Publication Date: 2023.11.07 MICROSOFT TECHNOLOGY LICENSING LLC
  • US11809436B2 patent drawing
  • US11809436B2 patent drawing
  • US11809436B2 patent drawing

AI summary

A syntax-based ranking technique is provided that ranks search results from multiple source code files in an order that considers the relevance of each matched term with a corresponding code type and the relevance of the type of file that contains the matched term. Boost values are provided for each code type of a matched term in order to weigh certain occurrences of the matched term with more relevance. Boost values are provided for each type of file that contains the matched term in order to weigh the occurrence of the term in a particular file with more relevance.