-
Notifications
You must be signed in to change notification settings - Fork 20
Description
I want to load an NHibernate entity from a DB, push it to an OpenSearch node for indexing, and then query OpenSearch using C# expressions.
Is that possible, and are there any examples for that (mainly the OpenSearch part)?
I was looking at the tests and I was hoping it would be something like this, but there is an apparent problem: I have not specified the OpenSearch Url anywhere (nhSession
is the session towards the DB):
IFullTextSession s = Search.CreateFullTextSession(nhSession); // nhSession is the session towards the DB.
using (ITransaction tx = s.BeginTransaction())
{
s.Save(doc);
tx.Commit();
var res = s.Query<Document>()
.Where(f => f.CreatedDate > DateTime.Parse("2023-08-01"))
.ToArray();
}
Is it possible to get an ISession
that points to an OpenSearch node or cluster, instead of a relational DB?
It would be nice to have some sample code in the README page.
Also, what I am trying to do when querying requires building complex filter conditions, unlike the examples here, so that's why I was wondering if I could use expressions, similar to what is shown for the Java version here.