Welcome,
Guest
|
|
Hi,
for now (perhaps, in future releases) IFile not have support native of "highlight". If you want create an process of "highlight", you must save the content of document and use a third part library, where you pass the search string and the content. If you use "lucene" interface, you can configured the "body" field as "Text". If field "body" is "Text", when get document you can get content indexing. But if the "body" field is "Text" the index is very big and performance degrades. If you use "mysqli" interface, the content is stored in DB and you can get (easy) the content. The problem is then the space on DB is very big (all textual content of the file is saved in DB), and if you have an hosting with a small DB space you can't use this interface.One solution for "lucene" interface might be: You indexing your document with "lucene" interface, whit "body" field "UnStored", and save the content in an file. Your serch index performance are very high, the delay is read content in the file. - you must modified one method (for now, IFile not return the object of document): public function addDocument(Zend_Search_Lucene_Document $doc = null) in IFile_Indexing_Abstract.php and return $doc. ....
// riporta il limite allo stato precedente
set_time_limit($defaultTimeLimit);
// new istruction
return $doc;
} Now, when you index file: Exemple (see exemple IFile_Ex01_IndexOneFile.php): ...
// get IFileFactory
$IFileFactory = IFileFactory::getInstance();
// index by Lucene interface
$ifile = $IFileFactory->getIFileIndexing('lucene', $index_path);
// set file of index
$ifile->setIndexFile($file);
// add documento to index
$doc = $ifile->addDocument();
// commit document
$ifile->commit();
$content = $doc->body;
$key = $doc->key;
// now create file with name, the value of field "key",
// and content the value of field "body" and save this in your filesystem.
... When you search, you can get the content from file (using field "key" of result search) and pass "content" and "string search" at library for highlight (see highligth of joomla). |
If you like, if it was useful, consider a donation, Thanks
Se vuoi, se ti siamo stati utili, considera una donazione, Grazie Help us by voting our extensions on Joomla.org: JiFile JoomPhoto Mobile Easy Language
Last Edit: 08 May 2012 18:28 by Giampaolo.
The administrator has disabled public write access.
|
If you not change browser settings, you agree to it. Learn more