Ramon Smits
Ramon Smits

Reputation: 2618

Howto search all fields with NHibernate Search?

NHibernate is working fine in my current solution but I would like to do queries that search all fields. How can I do something like

.CreateFullTextQuery<MyObjectGraph>("*", queryText)
.CreateFullTextQuery<MyObjectGraph>("%", queryText)
.CreateFullTextQuery<MyObjectGraph>("*:test")
.CreateFullTextQuery<MyObjectGraph>("%:test")

I tried the above but these do not work. I search for quite some time but cannot find a way to do this.

Upvotes: 2

Views: 381

Answers (1)

Pablo Ferro
Pablo Ferro

Reputation: 78

You have to write:

.CreateFullTextQuery<MyObjectGraph>("Field:{0}", criteria);

For example:

.CreateFullTextQuery<MyObjectGraph>("Name:{0}", "Ramon");

Upvotes: 2

Related Questions