SphinxConnector.NET 6.4 has been released

By Dennis

We're pleased to announce that SphinxConnector.NET 6.4 is now available via NuGet! You can also download a build from our site, but that only contains a version for .NET Framework 4.6.2 and higher.

This release adds support for Manticore's K-nearest neighbor (KNN) vector search and conversational search.

Manticore's KNN vector search lets you find documents whose embedding vectors are closest to a given query vector. You can use KNN within the fluent API's Where clause either on a property that implements IEnumerable if you choose to include the embedding vectors in your document model:

var results = await fulltextSession.Query<Document>().
                                    Match("Machine Learning").
                                    Where(x => x.EmbeddingVector.Knn("Machine Learning")).
                                    ToListAsync();

or specify the embedding vector's name dynamically:

var results = await fulltextSession.Query<Document>().
                                    Match("Machine Learning").
                                    Where(x => x.Knn("EmbeddingVector", "Machine Learning")).
                                    ToListAsync();

Here the query string "Machine Learning" is embedded and used for the KNN search, but you can also pass a pre-computed vector directly:

float[] queryVector = GetEmbedding("Machine Learning");

var results = await fulltextSession.Query<Document>().
                                    Where(x => x.EmbeddingVector.Knn(queryVector)).
                                    ToListAsync();

Two new functions are also available:

  • Function.KnnDist() returns the KNN vector search distance for the current match
  • Function.HybridScore() returns the hybrid search RRF fusion score when combining full-text and KNN results

For instance, to order results by their combined hybrid score:

var results = await fulltextSession.Query<Document>().
                                    Match("Machine Learning").
                                    Where(x => x.EmbeddingVector.Knn("Machine Learning")).
                                    Select(x =>
                                    {
                                        Doc = x,
                                        Score = Function.HybridScore())
                                    }
                                    Options(o => o.Set("fusion_method", "'rrf'").
                                    ToListAsync();

Note that the fusion_method option must be set to 'rrf', see Hybrid Search for more information.

Manticore's conversational search is now accessible via the fluent API:

The Advanced operations API provides methods for creating

using var fulltextSession = fulltextStore.StartSession();

fulltextSession.Advanced.CreateChatModel("assistant", "openrouter:openrouter:nvidia/nemotron-3.5-embed-1b:free");

and dropping chat models.

fulltextSession.Advanced.DropChatModel("assistant");

Sending a conversational search request is done via the Chat method:

var request = new ChatRequest("What are the key benefits of vector search?", "assistant");

var response = await fulltextSession.ChatAsync<Document>(request);

The ChatResponse class contains the LLM-generated answer, the search query used for retrieval, the conversation UUID (which you can reuse for follow-up questions), and the source documents in JSON format.

Other Changes

The BulkCopy class now properly escapes all attribute/column names.

For a full list of changes, please refer to the version history.

Updated Sample Applications available

By Dennis

We've updated our Stackoverflow with Sphinx sample to an ASP.NET Razor Pages application running on .NET 10 against the latest versions of Sphinx/Manticore Search. The data import was updated to use the BulkCopy class and we added a test project to show how to make use of TestContainers.NET to test an application against a "real" instance of searchd.

The quickstart sample for the fluent API has been updated too.

Both samples are now available on GitHub.

SphinxConnector.NET 6.3 has been released

By Dennis

We're pleased to announce that SphinxConnector.NET 6.3 is now available via NuGet! You can also download a build from our site, but that only contains a version for .NET Framework 4.6.2. and higher.

This release adds support for using records either as document models or projection targets to the fluent API. So the document model from our introductory example can be reduced to:

public record Book(int Id, string Title, string Author, decimal Price, bool EbookAvailable, DateTime ReleaseDate, 
                   IList<long> Categories, int Weight);

Using records is probably even more useful when you are projecting into a new result e.g.:

public record SearchResult(int Id, string TitleSnippet, decimal Price);

var searchResults = await FulltextSession.Query<Book>().
                                          Match("*programming*").     
                                          Limit(0, 20).
                                          Select(x => new SearchResult(x.Id, x.Title.GetSnippet(), x.Price)).
                                          ToListAsync();

For users of Manticore Search we've added support for calling the Autocomplete function via the fluent API:

using var fulltextSession = fulltextStore.StartSession();

var results = await fulltextSession.AutocompleteAsync<Book>("Charles P");

//Options can be changed via AutocompleteOptions:
var options = new AutocompleteOptions { Append = true, Prepend = true };

var results = await fulltextSession.AutocompleteAsync<Book>("Charles P", options);

If you are using Sphinxsearch you can now use the TDIGEST function in your queries.

The full list of changes is available in the version history.

SphinxConnector.NET 6.2 has been released

By Dennis

We're pleased to announce that SphinxConnector.NET 6.2 is now available via NuGet! You can also download a build from our site, but that only contains a version for .NET Framework 4.6.2. and higher.

This release adds support for Manticore's scroll token feature to the fluent API:

//Retrieve the token via the Scroll() method:
var firstResult = await FulltextSession.Query<Book&>().
                                        OrderBy(x => x.ReleaseDate).
                                        ThenBy(x => x.Id).
                                        Limit(0, 20).
                                        Scroll(out ScrollToken token).
                                        ToListAsync();

 //Pass the token to the next query via Options() and also retrieve the new token:
 var secondResult = await FulltextSession.Query<Book>().
                                          Limit(0, 20).
                                          Scroll(out ScrollToken nextToken).
                                          Options(o => o.Scroll(token.Value)).
                                          ToListAsync();

It can of course also be used with future and prepared queries.

SphinxConnector.NET 6.1 has been released

By Dennis

We're pleased to announce that SphinxConnector.NET 6.1 is now available via NuGet! You can also download a build from our site, but that only contains a version for .NET Framework 4.6.2. and higher.

This release adds support for authenticated connections to Sphinx and Manticore Search. Please note that with Sphinx, only SHA1 hashed passwords (mysql_native_auth) are supported in this release.

We’ve also added the ability to configure the logger provider and set the license key during the FulltextStore initialization call:

var fulltextStore = new FulltextStore().Initialize(c => c.SetLicense("Your license key").
                                                          SetLoggerProvider(new ConsoleLoggerProvider()));

This should make for some nicer setup during container registration of the fluent API classes.

Additionally, you can now set the license key via an environment variable called SPHINXCONNECTOR_LICENSE_KEY for scenarios where you the retrieve the key from a vault of some kind, e.g. for containerized setups.

For a full list of changes, please refer to the version history.