From 744e56a5abaf1e8e4927d7de4426a22f4684576c Mon Sep 17 00:00:00 2001 From: Ritchie Mwewa <74001397+rly0nheart@users.noreply.github.com> Date: Mon, 12 May 2025 11:58:55 +0200 Subject: [PATCH] Update README.md --- README.md | 48 +++++++++++++++++++++--------------------------- 1 file changed, 21 insertions(+), 27 deletions(-) diff --git a/README.md b/README.md index 72720a5..d9522cb 100644 --- a/README.md +++ b/README.md @@ -32,32 +32,6 @@ pip install searchcode ## Getting Started -### Code Search - -Queries the code index and returns at most 100 results. - -#### Params - -- `query`: Search term (required). - - The following filters are textual and can be added into query directly - - Filter by file extention **ext:EXTENTION** e.g., _"gsub ext:erb"_ - - Filter by language **lang:LANGUAGE** e.g., _"import lang:python"_ - - Filter by repository **repo:REPONAME** e.g., _"float Q_rsqrt repo:quake"_ - - Filter by user/repository **repo:USERNAME/REPONAME** e.g., _"batf repo:boyter/batf"_ -- `page`: Result page starting at 0 through to 49 -- `per_page`: Number of results wanted per page (max 100). -- `languages`: List of programming languages to filter by. -- `sources`: List of code sources (e.g., GitHub, BitBucket). -- `lines_of_code_gt`: Filter to sources with greater lines of code than supplied int. Valid values 0 to 10000. -- `lines_of_code_lt`: Filter to sources with less lines of code than supplied int. Valid values 0 to 10000. -- `callback`: Callback function (JSONP only) - -> If the results list is empty, then this indicates that you have reached the end of the available results. - -> To fetch all results for a given query, keep incrementing `page` parameter until you get a page with an empty results -> list. ---- - ### Code Search Without Filters #### Command-Line Interface @@ -169,7 +143,27 @@ search = sc.search(query="import module", callback="myCallback") pprint(search) ``` -` +### Params + +- `query`: Search term (required). + - The following filters are textual and can be added into query directly + - Filter by file extention **ext:EXTENTION** e.g., _"gsub ext:erb"_ + - Filter by language **lang:LANGUAGE** e.g., _"import lang:python"_ + - Filter by repository **repo:REPONAME** e.g., _"float Q_rsqrt repo:quake"_ + - Filter by user/repository **repo:USERNAME/REPONAME** e.g., _"batf repo:boyter/batf"_ +- `page`: Result page starting at 0 through to 49 +- `per_page`: Number of results wanted per page (max 100). +- `languages`: List of programming languages to filter by. +- `sources`: List of code sources (e.g., GitHub, BitBucket). +- `lines_of_code_gt`: Filter to sources with greater lines of code than supplied int. Valid values 0 to 10000. +- `lines_of_code_lt`: Filter to sources with less lines of code than supplied int. Valid values 0 to 10000. +- `callback`: Callback function (JSONP only) + +> If the results list is empty, then this indicates that you have reached the end of the available results. + +> To fetch all results for a given query, keep incrementing `page` parameter until you get a page with an empty results +> list. +--- ### Response Attribute Definitions