You are viewing limited content. For full access, please sign in.

Question

Question

LFDatabase.ReindexSearchbase cause "The search engine encountered an internal error. Please check the search engine error log for more details." error

asked on March 24, 2014

 I have Laserfiche Client 8.3 installed on my computer. I use LFSO80Lib reference.

 

This is part of my code,

  1. private LFDatabase db;
  2. db.ReindexSearchbase(false);
  3. LFSearch search = db.CreateSearch();
  4. search.Command = "xxx";
  5. search.BeginSearch(true);

  6. ILFCollection hits = search.GetSearchHits();
     

No matter I use true or false ReindexSearchbase always causes error.

"The search engine encountered an internal error. Please check the search engine error log for more details."

 

It works if I comment out the  ReindexSearchbase line. But the returned search result, hits, is not sorted.

 

It worked when I had Laserfiche Client 8.1 and use LFSO82Lib reference.

 

Does anyone know how to fix this error?

0 0

Answer

SELECTED ANSWER
replied on March 24, 2014

Documents get indexed by default on creation and when their text changes. It needs to be done once, not right before every search. The command you're using reindexes all documents in the repository, which can take a while. During indexing, not all documents will be available for search.

 

The search engine indexes documents during normal operation, you can just take out that line from your script.

2 0

Replies

replied on March 24, 2014

Why are you reindexing all the documents before every search?

0 0
replied on March 24, 2014

because in the Toolkit it says "In order to perform a full-text search on a document, it must be indexed. To index documents in LFSO, you can use the ReindexSearchbase method of the LFDatabase object.".

0 0
SELECTED ANSWER
replied on March 24, 2014

Documents get indexed by default on creation and when their text changes. It needs to be done once, not right before every search. The command you're using reindexes all documents in the repository, which can take a while. During indexing, not all documents will be available for search.

 

The search engine indexes documents during normal operation, you can just take out that line from your script.

2 0
replied on March 25, 2014

Miruna,

 

Thanks for your reply. One more question, search.GetSearchHits() returns an unsorted list. How to sort by Entry.Name? Thanks

0 0
replied on March 25, 2014

You need to get your results as a list in order to sort them. See the LFSearch.GetSearchResultListing method in your SDK documentation.

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.