bleve

package
v0.2.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 31, 2023 License: Apache-2.0 Imports: 20 Imported by: 0

README

Bleve

This directory contains an experimental search implementation built with https://blevesearch.com. Specs are indexed as full-text blobs and queried with the Bleve default queries.

Note that all calls below require that registry-experimental be configured to use a registry-server instance.

Index specs with the following, where PATTERN should match one or more specs:

registry-experimental bleve index PATTERN

The index will be stored locally in registry.bleve. Use the --bleve option to specify an alternate location.

Search the index with the following:

registry-experimental bleve search QUERY

Indexing and search are also available with a simple REST API that is provided by bleve serve.

First run registry-experimental bleve serve. While it is running, specs can be indexed and searched as follows:

Specs can be indexed by posting JSON to the /index endpoint:

curl http://localhost:8888/index \
    -X POST \
	-H "Content-Type: application/json" \
	-d @- \
	<<EOF
{
	pattern: "projects/${PROJECT_ID}/locations/global/apis/-/versions/-/specs/-",
	filter: "mime_type.contains('openapi')",
}
EOF

Note that the `filter` value is optional.

Specs be searched with `/search`:

curl http://localhost:8888/search?q=domain


This searches for specs containing the word "domain".

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Command

func Command() *cobra.Command

Types

type IndexRequestBody added in v0.2.3

type IndexRequestBody struct {
	Pattern string `json:"pattern"`
	Filter  string `json:"filter"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL