Reputation: 1791
I am struggling with a bug/problem that I am having trouble with when using Zend_Search_Lucene. Now I have 2 indexes that I search one that is parsed html pages/text that I use the Zend_Search_Lucene_Document_Html::loadHTML() function to read the contents and add to one of the lucene indexes.
The other index I manually create a lucene document using the Zend_Search_Lucene_Document() function, adding text and keyword fields to the document.
Both methods to add data to my indexes work, and using Luke (awesome tool) to view the indexes I can see the different documents in both indexes and I can write manual queries using Luke that return results.
I am currently getting errors when I search against the index containing the manually created documents. When building queries using the Query API provided in the framework, I get the number of results that I am expecting however when I try to get the "Document" from this search hit, there is nothing being returned.
I'm getting the following errors
Warning: fseek(): supplied argument is not a valid stream resource in C:\www\mysite\development\website\library\Zend\Search\Lucene\Storage\File\Filesystem.php on line 93
Warning: fread(): supplied argument is not a valid stream resource in C:\www\mysite\development\website\library\Zend\Search\Lucene\Storage\File\Filesystem.php on line 158
Warning: flock() expects parameter 1 to be resource, integer given in C:\www\mysite\development\website\library\Zend\Search\Lucene\Storage\File\Filesystem.php on line 214
Uncaught exception 'Zend_Search_Lucene_Exception' with message 'Field name "itemname" not found in document.'
If I run searches on the indexes with the HTML content and the Query API I get results with documents in them that I can get some of the document data from.
With both queries I am generating search queries using the Zend_Search_Lucene_Search_QueryParser::parse() function with some added Subqueries.
Is there any known issues why when parsing a document my searches against them run fine, but the ones on documents that I create fail with the error messages above?
Many thanks,
Grant
Upvotes: 1
Views: 569
Reputation: 11
Just a note, I received these errors when I tried to store Lucene search results in the Session file for use on another page.
Cleared the session, put in some code to store the result info I needed as an instance of stdClass() and then saved that in the session and all was ok again.
I'd basically say your trying to retrieve something todo with Lucene which was saved to the file system, whether that be Zend Cache, the session or whatever.
Upvotes: 1