Closed (fixed)
Project:
Search Lucene API
Version:
6.x-2.1
Component:
Code
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
24 Feb 2010 at 09:30 UTC
Updated:
28 Mar 2010 at 19:00 UTC
Jump to comment: Most recent file
Comments
Comment #1
wimh commentedBTW this is only with 2.1. Doing the exact same search with 2.0 worked without problems.
Comment #2
cpliakas commentedCould you tell me what searches are working? What searches are not working? If there is some pattern to what is breaking the search, it will help me resolve this more quickly.
Thanks,
Chris
Comment #3
cpliakas commentedHi wim.
I added some defensive coding to prevent the error, but my though is that if you are getting an insignificant query object, the parser is not able to parse the search terms for some reason. I would make 100% sure that there are no errors in admin/reports/status, and I would also verify that the iconv extension is available on the server. Please see if the attached patch fixes your issue.
Thanks,
Chris
Comment #4
wimh commentedHi Chris,
Your patch does solve the symptoms. But now that I was able to dig a bit further:
* the search query I was using came from the Search404 module, which I patched to use Lucene search: #603758: Use Search Lucene Content when available
* I browsed to the invalid path /aadmin/settings/mollom, which makes Search404 generate the search query "aadmin OR settings OR mollom" and pass it to lucenceapi_node_search
* this in itself works
The problem occurs in a *second* call of luceneapi_query_parse(), made by luceneapi_facet (I have a facet search block enabled)
* the $keys argument to this call is NULL, causing the Zend_Search_Lucene_Search_Query_Insignificant query object
* luceneapi_facet.module:luceneapi_facet_block_realm_render(), the one making the call to luceneapi_query_parse(), gets $keys from search_get_keys()
* since the search did not originate from the search form, search_get_keys() returns nothing.
The search404 module defines its own search404_get_keys(), which is duly passed to the first luceneapi_query_parse() call, but not to the second luceneapi_facet-initiated one.
To solve this properly, I would say that the luceneapi_facet module should get the search keys directly from luceneapi/luceneapi_node in some way, and not assume that the regular search form was used. But I have no idea if this is doable or even possible...
Comment #5
cpliakas commentedHi Wim.
Thanks for the detailed use case! It is much appreciated. I agree with you that architecturally the search keys should not be dependent on search_get_keys(), and it is a great observation on your part. I am going to download the Search 404 module, apply your patch, and try to come up with a solution. I love it when developers integrate with other contribs, so I will do my best to come up with a working solution we all can live with. The search_get_keys() issue can get a bit tricky and is one of the problems with the core Search API, but my first though is there has to be a way around this.
Again, thanks for your great detective work!
~Chris
Comment #6
cpliakas commentedThis patch will be applied as part of the #719836: Add defensive coding to the luceneapi_query_parse() API function task.
Comment #7
cpliakas commentedFixed in issue #719836: Add defensive coding to the luceneapi_query_parse() API function.
Comment #9
wimh commentedFYI: the patch to use Lucene Search in the Search 404 module is included in their 6.x-1.9 release.
Comment #10
cpliakas commentedThanks for the follow-up, Wim!