lucene - Sitecore 7 Search, cannot access a disposed object -


I'm working with some Cycorecore 7 search codes. Example below

  (var references = Index.CreateSearchContext ()) {// .... Build predicates var query = context.GetQueryable & lt; SearchResultItem & gt; (). Where to predicate; Return query. GETResults (); }   

This works fine in SOLR, but standard is used with Lucene, whenever I use SearchResults & lt; SearchResultItem & gt; I refer to a property in GetResults ()) , " can not use a disposable object " with sitcom errors. It appears that does not encode GetResults () and is still hung on the search context.

Has anyone come before this and know how okay?

thanks

Ian

/ div>

It looks like SearchResults & lt; T & gt; In the context of SearchHit and LuceneSearchProvider does not open a reader, the new version of Lusen automatically closes the reader, I think you return the wrong type You may have to:

  var query = context.GetQueryable & lt; SearchResultItem & gt; (). Where (point); Return query. Toolist ();   

While making sure that many do not come back, you should probably use () and so on.

Comments

Popular posts from this blog

c - Mpirun hangs when mpi send and recieve is put in a loop -

python - Apply coupon to a customer's subscription based on non-stripe related actions on the site -

java - Unable to get JDBC connection in Spring application to MySQL -