Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
DumboJet opened this issue Sep 8, 2023 · 0 comments
Open

Comments

@DumboJet
Copy link

DumboJet commented Sep 8, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant