Git Product home page Git Product logo

resin___google_and_altavista_killer_search_engine's Introduction

SIR

16-bit wide vector-space model search engine with HTTP API and programmable read/write pipelines.

Demo

What is this?

Vector-space model

To provide full-text search words and phrases extracted from documents are mapped to a 65k dimensional vector-space that form clusters of syntactically similar "bag-of-chars".

On disk and in-memory this model is represented as a binary tree (VectorNode).

Each node carries as their payload a list of document references.

This model works well with fuzzy/prefix/suffix queries and with phrases that appromixate each other.

API

API write

IEnumerable<IDictionary> data = GetData();

var sessionFactory = new SessionFactory(@"c:\mydir");

using (var writer = new Writer(sessionFactory, new LatinTokenizer()))
{
	writer.Write("mycollection", data);
}

HTTP Write

To create a collection (table) and add three documents:

HTTP POST http://localhost:54865/io/mycollection
Content-Type: application/json

Body:

[
	{
		"id":"0",
		"year":"1982",
		"title":"First Blood",
		"body":"Former Green Beret John Rambo is pursued into the mountains surrounding a small town by a tyrannical sheriff and his deputies, forcing him to survive using his combat skills."
	},
	{
		"id":"1",
		"year":"1985",
		"title":"Rambo: First Blood Part II",
		"body":"John Rambo is released from prison by the government for a top-secret covert mission to the last place on Earth he'd want to return - the jungles of Vietnam."
	},
	{
		"id":"2",
		"year":"2008",
		"title":"Rambo",
		"body":"In Thailand, John Rambo joins a group of mercenaries to venture into war-torn Burma, and rescue a group of Christian aid workers who were kidnapped by the ruthless local infantry unit."
	}
]

Response:

HTTP 201 Created
Location: /io/mycollection

API Read/query

var query = new BooleanKeyValueQueryParser().Parse("title:rambo\n+title:first blood", new LatinTokenizer());
query.CollectionId = "mycollection".ToHash();
var sessionFactory = new SessionFactory(@"c:\mydir");
var reader = new Reader(sessionFactory);
var documents = reader.Read(query);

HTTP Read/query

HTTP PUT http://localhost:54865/io/mycollection
Content-Type: text/plain

Body:

title:rambo
+title:first blood

Response:

[
	{
		"id": "1",
		"year": "1985",
		"title": "Rambo: First Blood Part II",
		"body": "John Rambo is released from prison by the government for a top-secret covert mission to the last place on Earth he'd want to return - the jungles of Vietnam."
	}
]

HTTP Update

HTTP PUT http://localhost:54865/io/mycollection/1/?key=id

Body:

[
	{
		"id": "1",
		"year": "1985",
		"title": "Rambo: First Blood Part II (second-best movie ever)",
		"body": "John Rambo is released from prison by the government for a top-secret covert mission to the last place on Earth he'd want to return - the jungles of Vietnam."
	}
]

HTTP Delete

HTTP DELETE http://localhost:54865/io/mycollection

Body:

title:first blood

Response:

HTTP 202 Marked for deletion

Platform

.NET Core 2.0.

resin___google_and_altavista_killer_search_engine's People

Contributors

abdullah2993 avatar alexanderpersson avatar bradparks avatar jhashemi avatar kreeben avatar shanselman avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.