Forums / General / Search files in eZ 3.9.2
pascal c
Thursday 08 May 2008 4:15:37 am
Hi everyone;hope this is the right place to ask. I have to get into an eZ project; being new to this CMS it's a little hard to find all information needed specially between the different versions.
We would like to be able to add a search module that would also search the file content. I know this is possible in version 4.x; is it in 3.9.2 or not at all?If it is; how would I add a search module in the site template and have this module search the files?
Thanks.
Felix Laate
Thursday 08 May 2008 4:32:12 am
Hi Pascal,
it's indeed possible. Have a look here http://ez.no/doc/ez_publish/technical_manual/3_9/reference/datatypes/file at the bottom.
Also this http://ez.no/developer/articles/indexing_multiple_binary_file_types might be of interest.
Felix
Publlic Relations Manager Greater Stavanger www.greaterstavanger.com
Thursday 08 May 2008 5:12:02 am
Hi and thank you Felix; I'm looking inside the administration interface but I can't find such data type option when I create a file type object in the Content tab.EDIT: I found it after a little more searches, files are now searchable (option checked)
Something I notice too is when I create a Content of file type, I specify a document (1.1M) but it never shows when I preview it. How come? The file class allows 4M (was on 0 before so changed for a try) and php configuration allow upload (turned On and has a max upload value of 4M) Why?And how do I display a search form to search files?
Thanks
Friday 09 May 2008 2:59:19 am
Hi again,
if you're not able to upload files it might be that file_uploads are not enabled in the site.ini-file or there could be a problem with permissions or a num,ber of other potetional things. Turn on debugging and see if that gives a hint.
When it come to showing a search-form, have a look here http://ez.no/ezpublish/documentation/customization/components/search/custom_search_box (it's a bit old but still of interest).
Friday 09 May 2008 3:04:51 am
Hello Felix; you were right, it was a problem with permissions; the debug helped me. Thanks for that.I'm now looking at your link for the Custom search box.
One thing I'm wondering is why when I search within the administration of the site it can't find files I upload when creating a element of type file.Specifying a part of the file name I've uploaded when creating the element in the search box doesn't show any result. Even if I specify the type to search (File) location to search in etc.
I'll read that article now.
Best regards.Scal
Friday 09 May 2008 6:21:47 am
Ok; I've added this form in my template: <form action={"/content/advancedsearch/"|ezurl} method="get"> <input class="searchbox" type="text" size="8" name="SearchText" id="Search" value="" /> <input class="searchbutton" name="SearchButton" type="submit" value="Search" /> <input type="hidden" name="SearchContentClassID" value="12" /> </form> But the search doesn't even find any document I've uploaded by name.I added the wildcard option in the site.ini.append.php override file; it works for the name of the object but not when I search the document title nor when I search text inside my documents (I use pdf and txt files for tests at the moment, txt files are being returned by search but not PDFs); I'm lost even with the articles and docs.
Any help would be appreciated.
Gurudutt Verma
Friday 23 May 2008 1:16:27 am
First Check your File class definition under Setup -> Classes -> media most probabely http.//site_url.ext/class/view/28
And check if File attribute is marked as searchable.
if above settings is okey then check if you have installed all your document and pdf parsers properly.
For pdf parser you might have to optimize it little, see this link may help you.http://ez.no/ezpublish/documentation/configuration/optimization/speeding_up_acrobat_pdf_document_indexing_