SphinxConnector.NET 3.9 has been released

by Dennis 27. February 2014 15:36

We're pleased to announce that SphinxConnector.NET 3.9 is available for download and via NuGet!

This is mainly a maintenance release with bug fixes and a few new features. The complete list of changes is available in the version history.

Tags:

Announcements

SphinxConnector.NET 3.8 has been released

by Dennis 14. November 2013 11:49

The long awaited beta of Sphinx 2.2.1 has just been released, and we're following suit with releasing version 3.8 of SphinxConnector.NET! It is available for download and via NuGet!

SphinxConnector.NET 3.8 contains a bulk of changes to support new features that have been introduced with Sphinx 2.2.1: the support for JSON attributes has been greatly expanded with the newest Sphinx release. New functions like IN, ALL, ANY, and INDEXOF have been added to JSON arrays. These functions are supported through their .NET equivalents via IEnumerable, IList, and SphinxConnector.NET’s In() extension method, e.g.:

using (IFulltextSession fulltextSession = fulltextStore.StartSession())
{
    var results = fulltextSession.Query<Product>().
                                  Select(p => new
                                  {
                                      Any = p.JsonTestEntity.Categories.Any(x => x > 2),
                                      All = p.JsonTestEntity.Categories.All(x => x < 5),
                                      IndexOf = p.JsonTestEntity.Categories.IndexOf(1),
                                      In = p.JsonTestEntity.Categories.In(1, 2, 3)
                                  }).
                                  Where(x => x.In).
                                  ToList();
}

Please note that the syntax for IN is a little different for JSON attributes than for MVAs: IN can only be used within SELECT and than be used as a filter in WHERE, instead of using it directly in the WHERE clause.

Other newly supported functions include LEAST, GREATEST, and LENGTH which work with both JSON arrays and MVAs via Min(), Max() and IEnumerable.Count(), ICollection.Count or Length:

using (IFulltextSession fulltextSession = fulltextStore.StartSession())
            {
                var results = fulltextSession.Query<JsonTestObject>().
                                              Select(p => new
                                              {
                                                  Min = p.JsonTestEntity.Categories.Min(),
                                                  Max = p.JsonTestEntity.Categories.Max(),
                                                  Count = p.JsonTestEntity.Categories.Count,
                                              }).
                                              ToList();
            }

Note that LENGTH() has been available since the release of Sphinx 2.1.2.

Another new feature of Sphinx 2.2.1 is the HAVING clause, which is now also supported by the fluent API:

using (IFulltextSession fulltextSession = fulltextStore.StartSession())
{
    var results = fulltextSession.Query<Product>().
                                  Match("a product").
                                  GroupBy(p => p.VendorId).
                                  Select(p => new
                                  {
                                      p,
                                      Count = Projection.Count()
                                  }).
                                  Having(p => p.Count > 1).
                                  ToList();
}

The next feature has been supported by Sphinx for some time and can now be used from the fluent API: user variables with IN and NOT IN:

using (IFulltextSession fulltextSession = fulltextStore.StartSession())
{
    var results = fulltextSession.Query<Product>().
                                  Where(p => p.CategoryId.In("@my_user_var")).
                                  ToList();
}

There are a few more new features not mentioned here, which you can find in the version history.

Tags:

Announcements

SphinxConnector.NET 3.6 has been released

by Dennis 13. June 2013 11:02

We're pleased to announce that SphinxConnector.NET 3.6 is available for download and via NuGet!

This release adds support for features that have been added to the current Sphinx development branch (Sphinx 2.2.1). This includes the ability to filter on JSON strings with the native API and support for the new Tf-Idf option, which has been added to both fluent and native API.

The fluent API now also supports the max_predicted_time option (Sphinx 2.1.1) and retrieving predicted metadata values (Sphinx 2.2.1). Additionally a regression in the FlushChanges method has been fixed, where internal exceptions weren't correctly wrapped in a FulltextException.

As always, the complete list of changes is available in the version history.

Tags:

Announcements

SphinxConnector.NET 3.5 has been released

by Dennis 14. May 2013 09:35

We're pleased to announce that SphinxConnector.NET 3.5 is available for download and via NuGet!

The new version introduces support for subqueries with the fluent query API. Additionally, supported DateTime properties can now be used directly in a group-by clause. And speaking of group-by, we've added support for selecting the n best results of a group, for those of you that are already experimenting with Sphinx 2.2.1!

We've also fixed two bugs and made some more optimizations to the SphinxQL and fluent API.

Tags:

Announcements

SphinxConnector.NET 3.4 has been released

by Dennis 16. April 2013 11:45

We're pleased to announce that SphinxConnector.NET 3.4 is available for download and via NuGet!

With the new version you can now use the fluent API to execute SphinxQL queries and take advantage of its object mapping capabilities. This gives you the ability to gradually move existing SphinxQL queries to the fluent API, and to execute queries not yet supported by the fluent API without having to manually construct your document objects:

using (IFulltextSession session = fulltextStore.StartSession())
{
    ISphinxQLExecutor executor = session.Advanced.CreateSphinxQLExecutor();

    var parameters = new { query = "a product" };
    var results = executor.Query<Product>("SELECT * FROM products WHERE MATCH(@query)", 
parameters); }

Please note that this feature is only available with .NET 4.

Also, the fluent API now allows grouping by multiple attributes (Sphinx 2.1.2), and projections into anonymous types support using the document object as a property and the creation of nested anonymous types.

Tags:

Announcements