This seems to be a bug in the FullTextQueryImpl. See below. I changed
classes[0].Name to classes[0].FullName and ReflectHelper.ClassForName
(targetEntity) to ReflectHelper.ClassForFullName(targetEntity)
Is this correct? Can submit a patch if required. Please let me know
where to.
if (criteria is CriteriaImpl)
{
string targetEntity =
((CriteriaImpl)
criteria).EntityOrClassName;
if (classes.GetLength(0) == 1
&& classes[0].FullName !=
targetEntity)
{
throw new
SearchException("Criteria query entity should match
query entity");
}
try
{
System.Type entityType
= ReflectHelper.ClassForFullName
(targetEntity);
classes = new
System.Type[] { entityType };
}
On Jan 25, 11:30 pm, nabils <[email protected]> wrote:
> I have the following query and criteria:
>
> var criteria = session
> .CreateCriteria(typeof (Domain.Model.Person))
> .SetFetchMode("Title", FetchMode.Join);
>
> var people = search.CreateFullTextQuery(query, typeof
> (Domain.Model.Person))
> .SetCriteriaQuery(criteria)
> .List<Domain.Model.Person>();
>
> I keep getting the follwoing exception when calling list
> NHibernate.Search.Impl.SearchException occurred
> Message="Criteria query entity should match query entity"
> Source="NHibernate.Search"
> StackTrace:
> at NHibernate.Search.Query.FullTextQueryImpl.GetLoader(ISession
> session)
> at NHibernate.Search.Query.FullTextQueryImpl.List(IList list)
> at NHibernate.Search.Query.FullTextQueryImpl.List()...
>
> Would really appreciate some help. I have tried absolutely everything.
> Without a fix for this NH search is not much use to me which would be
> a real shame.
>
> Thanks in advance
--
You received this message because you are subscribed to the Google Groups
"nhusers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/nhusers?hl=en.