Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

github.com/doctor-eval/gosearch

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/doctor-eval/gosearch

  • v0.0.0-20220227001324-62f114b35cbd
  • Source
  • Go
  • Socket score

Version published
Created
Source

GoSearch

Motivation

I just wanted to learn how to write a search engine from scratch without any prior experience.

Features

  • Index content
  • Search content
  • Index content REST API
  • Search content REST API
  • Delete content
  • Delete content REST API
  • Update content
  • Update content REST API

REST API

Index a new document:
curl -X POST http://localhost:8080/v1/insert -d "{\"content\": \"lorem ipsum\"}"

Search through all documents:
curl -X GET http://localhost:8080/v1/search?q=lorem

Golang API

First install the package via Go Mod:

go get github.com/micheleriva/gosearch

Then you can use its native Golang APIs to index and search for documents:

package main

import (
	"fmt"
	"github.com/micheleriva/gosearch"
)

func main() {
  gosearch.IndexDocument("Love is old, love is new, love is all, love is you")
  gosearch.IndexDocument("What is love? Baby don't hurt me, no more.")
  
  results := gosearch.Search("love")
  fmt.Println(results)
  // => ["Love is old, love is new, love is all, love is you", "What is love? Baby don't hurt me, no more."]
}

License

gosearch is licensed under the MIT license, but seriosuly, don't use it. Or do it at your own risk.

FAQs

Package last updated on 27 Feb 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc