Overview | How to install | User guide
Resin is a vector space index based search engine that's available as a HTTP service or as an embedded library.
HTTP POST [host]/write?collection=[collection]
(e.g. http://localhost/write?collection=mycollection)
Content-Type: application/json
[
{
"field1": "value1",
"field2": "value2"
}
]
using (var database = new DocumentDatabase<string>(_directory, collectionId, model, strategy))
{
foreach (var document in documents)
{
database.Write(document);
}
database.Commit();
}
HTTP GET [host]/query/?collection=mycollection&q=[my_query]&field=field1&field=field2&select=field1&skip=0&take=10
(e.g. http://localhost/write?collection=mycollection&q=value1&field=field1&field=field2&select=field1&skip=0&take=10)
Accept: application/json
HTTP POST [host]/query/?select=field1&skip=0&take=10
Content-Type: application/json
Accept: application/json
{
"and":
{
"collection": "film,music",
"title": "rocky eye of the tiger",
"or":
{
"title": "rambo",
"or":
{
"title": "cobra"
"or":
{
"cast": "antonio banderas"
}
}
},
"and":
{
"year": 1980,
"operator": "gt"
},
"not":
{
"title": "first blood"
}
}
}
using (var database = new DocumentDatabase<string>(_directory, collectionId, model, strategy))
{
var queryParser = database.CreateQueryParser();
var query = queryParser.Parse(collectionId, word, "title", "title", and:true, or:false, label:true);
var result = database.Read(query, skip: 0, take: 1);
}
Resin stores data as document collections. It applies your prefered IModel
Resin indices are binary search trees that create clusters of vectors that are similar to each other, as you populate them with your data. When a node is added to the graph its cosine angle, i.e. its similarity to other nodes, determine its position (path) within the graph.
Currently, Wikipedia size data sets produce indices capable of sub-second phrase searching.