I'm trying FullTextSearch functions from Foxit Pdf Sdk in Xamarin.Android. According to their document, result is kept in sqlite. I have a problem with retrieving result from sqlite and there is no document about retrieving in Foxit Sdk.
Here is my code.
int errCode = Library.Initialize(sn, key);
if (errCode != Constants.EErrSuccess)
return string.Empty;
var search = new FullTextSearch();
string dbPath = database;
search.SetDataBasePath(dbPath);
// Get document source information.
DocumentsSource source = new DocumentsSource(directory);
// Create a Pause callback object implemented by users to pause the updating process.
PauseUtil pause = new PauseUtil(30);
// Start to update the index of PDF files which receive from the source.
Progressive progressive = search.StartUpdateIndex(source, pause, false);
int state = Progressive.EToBeContinued;
while (state == Progressive.EToBeContinued)
{
state = progressive.Resume();
}
// Create a callback object which will be invoked when a matched one is found.
MySearchCallback searchCallback = new MySearchCallback();
// Search the specified keyword from the indexed data source.
bool isFinished = search.SearchOf(searchIndex, FullTextSearch.ERankHitCountASC, searchCallback);
First I created a property in SearchCallBack funtion.
When override RetrieveSearchResult is processing, I added result into list
And then I called SearchResults property from activity.