8000 Revive REST functionality with what conditions? · Issue #126 · google/zoekt · GitHub
[go: up one dir, main page]

Skip to content
This repository was archived by the owner on Mar 21, 2025. It is now read-only.
This repository was archived by the owner on Mar 21, 2025. It is now read-only.

Revive REST functionality with what conditions? #126

Open

Description

@robinp-tw

Hello,

I found there was REST search functionality that was deleted in 7444844. I find that functionality useful, so would like to restore it.

Can it be restored as-is (maybe with some tweaks, to support result size limit from request etc), or do you have any concerns with it? Thank you!

Activity

  1. hanwen commented on Dec 21, 2020

    @hanwen
    Contributor

    The REST support was removed because I added it to support some other functionality which never panned out.

    What do you want to do? I see two options:

    1. Make the core API available over HTTP / JSON.

    2. add a &format=JSON parameter to the Search endpoint in server.go, and dump the data in the web API format.

    my main concern is that I don't want to have an extra API flavor, because that necessarily will create extra conversion code that needs to be maintained.

    Maybe the srcgraph folks have ideas/preferences too. Summoning @keegancsmith

  2. keegancsmith commented on Jan 13, 2021

    @keegancsmith
    Contributor

    Maybe the srcgraph folks have ideas/preferences too. Summoning @keegancsmith

    We use "net/rpc" to remotely expose a "zoekt.Searcher". We originally used the json API, but quickly moved to something which can expose the core API. What about option 2, but directly marshalling the response from Searcher.Search into JSON?

    FYI we have been working on a streaming API internally, and will likely add an adapter to zoekt.Searcher which allows use to do streaming RPCs. I wasn't originally thinking this would be that useful to upstream, but if you feel otherwise we can debate that decision :)

  3. hanwen commented on Jan 13, 2021

    @hanwen
    Contributor

    Is the streaming just for the browser <-> server communications? You'd need all results anyway to sort the results, right?

  4. keegancsmith commented on Jan 13, 2021

    @keegancsmith
    Contributor

    Is the streaming just for the browser <-> server communications?

    browser <-> server. But we also want to do streaming between services so as to return the results sooner. We have use cases where a search can take a long time. For example a poor regular expression over a large cluster can take a while to return.

    You'd need all results anyway to sort the results, right?

    We currently aren't relying on ranking/sorting, so no. When we do start doing this, we will try and visit shards/repos in a smart order (somewhat like the rankedShard idea in zoekt).

  5. hanwen commented on Jan 13, 2021

    @hanwen
    Contributor

    might make sense to add an option "Unsorted" to the SearchRequest, then making all of the APIs streaming makes more sense.

  6. kisabaka commented on Oct 13, 2021

    @kisabaka

    @hanwen @keegancsmith
    JSON marshalling seems to be a simple change: kisabaka/zoekt@6b51c3c

    Let me know if you're happy with that approach

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      0