Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 21 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down