Skip to content

Is there any example on how to use this library against OpenSearch? #29

@DumboJet

Description

@DumboJet

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions