A Rust API search engine

Overview

Roogle

Roogle is a Rust API search engine, which allows you to search functions by names and type signatures.

Progress

Available Queries

  • Function queries
  • Method queries

Available Types to Query

  • Primitive types
  • Generic types
    • Without bounds and where predicates (e.g., <T>)
    • With bounds (e.g., <T: Copy>)
    • With where predicates
  • Custom types
    • Without generic args (e.g., IpAddr)
    • With generic args (e.g., Vec<T>, Option<T>)
  • Other types

Example

$ cargo r --release
# Then, on another shell session, run:
$ curl -X GET \
      -d "fn (Option<Result<T, E>>) -> Result<Option<T>, E>>" \
      "localhost:8000/search?scope=set:libstd"

Example with Docker

$ docker-compose up
# Then, on another shell session, run:
$ curl -X GET \
      -d "fn (Option<Result<T, E>>) -> Result<Option<T>, E>>" \
      "localhost:8000/search?scope=set:libstd"

Related Project

Comments
  • Are you interested in upstreaming this to rustdoc?

    Are you interested in upstreaming this to rustdoc?

    I haven't looked in detail how roogle currently works, but I would love for it to be the default search rustdoc uses for the standard library and docs.rs :) would you be interested in working on that if I help out with the rusrdoc-specific parts?

    opened by jyn514 6
  • If you can't serialise a crate it should warn but skip it rather than panic.

    If you can't serialise a crate it should warn but skip it rather than panic.

    If you can't serialise a crate it should warn but skip it rather than panic.

    Compiling roogle-api v0.1.0 (/home/gilescope/git/roogle/roogle-api) Finished release [optimized] target(s) in 6.47s Running target/release/roogle-api thread 'main' panicked at 'failed to deserialize: Error("invalid type: map, expected unit", line: 1, column: 7576)', roogle-api/src/main.rs:43:51 stack backtrace: 0: rust_begin_unwind at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/panicking.rs:515:5 1: core::panicking::panic_fmt at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/core/src/panicking.rs:92:14 2: core::result::unwrap_failed at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/core/src/result.rs:1599:5 3: core::ops::function::impls::<impl core::ops::function::FnOnce for &mut F>::call_once 4: <alloc::vec::Vec as alloc::vec::spec_from_iter::SpecFromIter<T,I>>::from_iter 5: roogle_api::krates

    C-enhancement A-error-handling 
    opened by gilescope 3
  • Exit successfully when encountered EOF

    Exit successfully when encountered EOF

    概要

    EOF を入力したときに CLI が異常終了するようになっている影響で、

    • パイプで入力を与えたとき
    • 入力待ち状態で Ctrl + D を入力したとき

    に panic! してしまうのを修正しました。

    変更前の挙動

    % echo "fn (Option<T>) -> bool" | cargo run -- --index assets/core.json
       Compiling roogle v0.1.3 (/Users/kodai/github/roogle/roogle)
        Finished dev [unoptimized + debuginfo] target(s) in 5.74s
         Running `target/debug/roogle --index assets/core.json`
    Some("is_none")
    Some("is_some")
    Some("is_empty")
    thread 'main' panicked at 'exitted repl', roogle/src/main.rs:48:18
    note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
    
    % echo $?
    101
    

    変更後の挙動

    % echo "fn (Option<T>) -> bool" | cargo run -- --index assets/core.json
       Compiling roogle v0.1.3 (/Users/kodai/github/roogle/roogle)
        Finished dev [unoptimized + debuginfo] target(s) in 5.17s
         Running `target/debug/roogle --index assets/core.json`
    Some("is_none")
    Some("is_some")
    Some("is_empty")
    
    % echo $?
    0
    
    opened by 0918nobita 0
  • Document possibility of indexing user provided crates

    Document possibility of indexing user provided crates

    It is possible to index user provided crates like so:

    export RUSTDOCFLAGS="-Zunstable-options --output-format=json"
    cargo +nightly doc
    

    Alternatively, in Rust:

    std::process::Command::new("cargo")
        .arg("+nightly")
        .arg("doc")
        .env("RUSTDOCFLAGS", "-Zunstable-options --output-format=json")
        .env("CARGO_TARGET_DIR", &index_dir)
        .current_dir(crate_path)
        .output();
    

    I think it would be useful to document this as an option somewhere in the roogle-engine documentation or README.md, or both. However, it does run into internal compiler errors, so it will not currently work for all projects.

    opened by philippeitis 0
  • Crazy feature request: rustc wrapper

    Crazy feature request: rustc wrapper

    A rustc wrapper that when it detects error message "expects X but found Y", searches roogle to offer some likely suggestions. Doing this properly might not be possible but a bit of ducktape-heath-robinson-hacking might make something that's actually really useful.

    C-feature-request 
    opened by gilescope 0
  • Feature request: Index workspace

    Feature request: Index workspace

    Would be cool to point this at a large workspace and have it index all the crates it finds there.

    I did something similar for undepend. Something like this should do the trick:

    use cargo_metadata::{Metadata, MetadataCommand};
    
     let metadata = MetadataCommand::new()
            .manifest_path(repo_dir.join("Cargo.toml"))
            .exec()
            .unwrap();
    
     for package in metadata.workspace_members.iter() {
    }
    
    C-feature-request 
    opened by gilescope 0
  • missing brackets leads to interesting results

    missing brackets leads to interesting results

    (Loving your work btw)

    fn (PathBuf) -> String returns sensible results.

    fn PathBuf -> String returns interesting results. I was just wondering if the prompt should be fn given that it has to be typed often and whether ( ) are needed for simple cases.

    A-error-handling A-parser 
    opened by gilescope 0
Owner
Roogle
A Rust API search engine
Roogle
Tantivy is a full-text search engine library inspired by Apache Lucene and written in Rust

Tantivy is a full text search engine library written in Rust. It is closer to Apache Lucene than to Elasticsearch or Apache Solr in the sense it is no

tantivy 7.4k Dec 28, 2022
AI-powered search engine for Rust

txtai: AI-powered search engine for Rust txtai executes machine-learning workflows to transform data and build AI-powered text indices to perform simi

NeuML 69 Jan 2, 2023
A full-text search engine in rust

Toshi A Full-Text Search Engine in Rust Please note that this is far from production ready, also Toshi is still under active development, I'm just slo

Toshi Search 3.8k Jan 7, 2023
Tantivy is a full text search engine library written in Rust.

Tantivy is a full text search engine library written in Rust. It is closer to Apache Lucene than to Elasticsearch or Apache Solr in the sense it is no

Quickwit OSS 7.4k Dec 30, 2022
Tantivy is a full-text search engine library inspired by Apache Lucene and written in Rust

Tantivy is a full-text search engine library written in Rust. It is closer to Apache Lucene than to Elasticsearch or Apache Solr in the sense it is no

Quickwit OSS 7.5k Jan 9, 2023
Python bindings for Milli, the embeddable Rust-based search engine powering Meilisearch

milli-py Python bindings for Milli, the embeddable Rust-based search engine powering Meilisearch. Due to limitations around Rust lifecycles, methods a

Alexandro Sanchez 92 Feb 21, 2023
A simple and lightweight fuzzy search engine that works in memory, searching for similar strings (a pun here).

simsearch A simple and lightweight fuzzy search engine that works in memory, searching for similar strings (a pun here). Documentation Usage Add the f

Andy Lok 116 Dec 10, 2022
Lightning Fast, Ultra Relevant, and Typo-Tolerant Search Engine

MeiliSearch Website | Roadmap | Blog | LinkedIn | Twitter | Documentation | FAQ ⚡ Lightning Fast, Ultra Relevant, and Typo-Tolerant Search Engine ?? M

MeiliSearch 31.6k Dec 31, 2022
High-performance log search engine.

NOTE: This project is under development, please do not depend on it yet as things may break. MinSQL MinSQL is a log search engine designed with simpli

High Performance, Kubernetes Native Object Storage 359 Nov 27, 2022
Perlin: An Efficient and Ergonomic Document Search-Engine

Table of Contents 1. Perlin Perlin Perlin is a free and open-source document search engine library build on top of perlin-core. Since the first releas

CurrySoftware GmbH 70 Dec 9, 2022
🔍TinySearch is a lightweight, fast, full-text search engine. It is designed for static websites.

tinysearch TinySearch is a lightweight, fast, full-text search engine. It is designed for static websites. TinySearch is written in Rust, and then com

null 2.2k Dec 31, 2022
⚡ Insanely fast, 🌟 Feature-rich searching. lnx is the adaptable deployment of the tantivy search engine you never knew you wanted. Standing on the shoulders of giants.

✨ Feature Rich | ⚡ Insanely Fast An ultra-fast, adaptable deployment of the tantivy search engine via REST. ?? Standing On The Shoulders of Giants lnx

lnx 679 Jan 1, 2023
⚡ Insanely fast, 🌟 Feature-rich searching. lnx is the adaptable deployment of the tantivy search engine you never knew you wanted. Standing on the shoulders of giants.

✨ Feature Rich | ⚡ Insanely Fast An ultra-fast, adaptable deployment of the tantivy search engine via REST. ?? Standing On The Shoulders of Giants lnx

lnx 0 Apr 25, 2022
Cross-platform, cross-browser, cross-search-engine duckduckgo-like bangs

localbang Cross-platform, cross-browser, cross-search-engine duckduckgo-like bangs What are "bangs"?? Bangs are a way to define where to search inside

Jakob Kruse 7 Nov 23, 2022
Configurable quick search engine shortcuts for your terminal and browser.

Quicksearch Configurable quick search engine shortcuts for your terminal and browser. Installation Run cargo install quicksearch to install Configurat

Rahul Pai 2 Oct 14, 2022
A full-text search and indexing server written in Rust.

Bayard Bayard is a full-text search and indexing server written in Rust built on top of Tantivy that implements Raft Consensus Algorithm and gRPC. Ach

Bayard Search 1.8k Dec 26, 2022
Image search example by approximate nearest-neighbor library In Rust

rust-ann-search-example Image search example by approximate nearest-neighbor library In Rust use - tensorflow 0.17.0 - pretrain ResNet50 - hora (Ru

vaaaaanquish 8 Jan 3, 2022
EasyAlgolia is a Rust crate designed for utilizing the Algolia admin client. It simplifies the process of updating and inserting documents into Algolia's search index.

crate link EasyAlgolia is a Rust crate designed for utilizing the Algolia admin client. It simplifies the process of updating and inserting documents

faizal khan 3 Mar 20, 2024
🔎 Impossibly fast web search, made for static sites.

Stork Impossibly fast web search, made for static sites. Stork is two things. First, it's an indexer: it indexes your loosely-structured content and c

James Little 2.5k Dec 27, 2022