Maybe i'm not doing something right here. The problem is that whenever I do a search (In the keyword textfield) I get no results. However if I do the same search in that textfield and apply Faceted search setting (Say I select node type A) I get my desired results. I assume that this isn't how things should work. Can I not do a search using only a keyword search?

CommentFileSizeAuthor
#18 encoding-case-fix.patch422 bytescpliakas
#17 php.txt48.86 KBben_scott
#11 query.txt1.87 KBben_scott

Comments

cpliakas’s picture

Hi walker2238.

Sorry for your troubles. Your assumption is correct in that a keyword search should work without having to select any facets, just like the core search or any other search. In terms of your specific problem, I cannot seem to replicate it, and I haven't encountered it before :-\. Do you have caching turned on? It may be worth clearing the results cache and seeing if that helps. The cached search query may have no results. Generally the caches are cleared when the index is updated or a node is deleted, but there may be some odd situation where the cache wasn't flushed properly. Another thing to look for is that there aren't any query string variables other than "page" or "q" for keyword searches without facets. Facet values are read from the query string, so there may be data inadvertently being passed adding an unintended filter. These are the only things I can think of off the top of my head, but I am curious to see if you are still having a problem so we can resolve any possible bugs in the code.

Thanks,
Chris

walker2238’s picture

Hey Chris thanks for the quick reply. This seems to be pretty odd. Caching is indeed off and I have cleared cache manually to double check. I think it's safe to rule out something related to indexing as the results are there for faceted searches. But I did re-indexing to make sure. The URL's seem fine (http://localhost/search/luceneapi_node/mykeyword). I'll try to uninstall/re-install this module along with the core search. I was previously trying out various search modules so maybe there could be a conflict within the database?

walker2238’s picture

Well I tried just about everything abd still no results with using just the keyword search.

shunting’s picture

Worked for me out of the box -- with the exception that re-indexing needed some fiddling with. I wiped, cron'ed, nada, disabled supercron, then rebuilt,cron'ed, it stuck at 38% indexed, then I turned off Enable node access and got to 100%.

All of which is a sloppy and not-bug-report-worthy way of asking if anything actually got indexed? Here's my file layout for the lucene index:

.../sites/default/files/luceneapi_node admin$ ls -c1
_w.cfs
_w.sti
optimization.lock.file
read-lock-processing.lock.file
read.lock.file
segments.gen
segments_16
write.lock.file

maybe if it doesn't look like that, that's the problem? No result because no index?

And your ZF library is installed?

Just because I've "found" all of those stumbling blocks...

walker2238’s picture

Hey shunting, my library is installed. Everything is indexed. All those files are within my luceneapi_node folder. As mentioned before if I do a normal keyword search no results are returned, however if I do that exact same search with a faceted search... (say I check a specific node type or taxonomy term) then results are returned. For some odd reason it seemed as if it was dependent on that.

I've since moved on to use views to create my search. No a huge deal just more customizing required. Although I'd like to figure out what is going on I don't have time to mess around at the moment. Thanks for the help guys and feel free to close this issue. If and when I get some time I'll do some more trouble shooting...

Walker

shunting’s picture

Damn. Well, we can always move my comment into the docmentation ;-)

cpliakas’s picture

Hi walker2238.

Sorry to hear that it isn't working for you :-\. Maybe there is a submit handler that is conflicting with Search Lucene API's. Without getting my hands on the installation, I cannot figure out why this would happen. I am going to leave this open for now in case anyone else has a similar issue. If you ever have time to debug or want to share any findings, please feel free to post to this thread again.

Thanks for your time in trying to find out what was wrong,
Chris

cpliakas’s picture

Component: User interface » Code
Category: support » bug
ben_scott’s picture

Hi -

I'm having a very similar problem to this: when I do just a keyword search nothing is found. And when I do a faceted search the keyword is ignored & only the node type is used - so if I select node type 'page', all pages are returned even if the keyword isn't present.

To try and find the problem, I've installed just the lucene_api module on a fresh Drupal version (6.13) so I don't think there can be conflicts with other modules (unless they're core). And all the files in post #4 are there - although the cfs/sti files are named _2.* rather than _w.* if that would matter?

Anyone know what might be causing this?

Thanks very much,

Ben

cpliakas’s picture

Hi Ben.

Thank you very much for posting. It is good to get confirmation of a bug report.

This may be a shot in the dark, but I would be very interested to see what would happen if you increase the weight of luceneapi and luceneapi_node so they are heavier than the node module. Off the top of my head, I can't think of another reason why this is happening. Have you tried the 2.0 dev version, or better yet the 6.x-1.2 version from http://ftp.drupal.org/files/projects/luceneapi-6.x-1.2.tar.gz ? I would be very anxious to see if I messed something up in a "fix" along the way. I don't think the file names you mentioned would matter, as the names of segment files change all the time.

Either way, I am very willing to help resolve the issue in any way I can. I cannot duplicate, so any information about your configuration settings, operating system, etc would be helpful. If you have the ability, I would love to see a var_dump() of the $keys and $sort variables around line 250 of the contrib/luceneapi_node/luceneapi_node.module file for flat keyword searches. Also, a var dump of the $query variable on line 277 of the same file would be very helpful. This one may be long, so it would be helpful if it could be attached as a text file.

Thank you in advance to anyone who provides the above information.

~Chris

ben_scott’s picture

StatusFileSize
new1.87 KB

Hi Chris -

Your very welcome - thanks so much for the module & looking into this so quickly. More than happy to post whatever info you need that'll help.

I tried changing the module's weight and installing 1.2 but neither worked I'm afraid.

var dump from line 150:

$keys: string(4) "test"
$sort: array(0) { }

The var dump of $query at line 277 is attached.

There aren't really any configuration settings - it's a fresh Drupal install with just the two Lucene API modules enabled, and all settings left as default. I'm running cron.php from the browser. I'm on XP/Wampserver, but I also tried it earlier on OSX 1.5/Mamp and had the same problem.

Running drush luceneapi size luceneapi_node returns 3 - there's only three nodes in the site, so I think they're getting indexed.

Thanks again,

Ben

cpliakas’s picture

Thanks! Very, very helpful. $keys looks good, but it looks like the $query object isn't being constructed properly. This definitely narrows it down. Let me look into this, and I will post back soon.

cpliakas’s picture

Priority: Normal » Critical
ben_scott’s picture

That'd be fantastic - thanks very much.

ben_scott’s picture

Hi Chris - I just tried 2.0 and the keywords are working in that version.

cpliakas’s picture

Thanks for checking that out, Ben.

The problem is with the query parser within the Zend Framework, which makes perfect sense now. For some reason, it cannot parse your query passed via the search form. I would have expected that it throw an exception, but it returns an object for an "insignificant" query instead which will return no results. Since the facet queries are constructed programmatically, they are unaffected by the bug and results will be returned. This must have been a bug that is fixed in the version of ZF that 2.0 uses.

What version of Wampserver are you using? I am going to try to reconstruct your environment when I am not at work so I can debug further. If you feel comfortable sharing your php.ini file either via this form or via email, it would help greatly. I understand there are security concerns here :-). This may be a situation where an upgrade of the ZF components will be required in the 1.5 release.

Thanks again for your help,
Chris

ben_scott’s picture

StatusFileSize
new48.86 KB

Hi Chris -

Sorry for not getting back to you yesterday - I'd just left work when you posted. I'm using WampServer 2.0 on XP, with PHP 5.2.6 & I've attached the php.ini file (I'm just working locally so it's no problem).

I'm not usually a windows user though, so I also set this up on my mac (running WAMP 1.7.2) to see if it was a problem with my environment - but I still got the same problem.

Hope that helps - good luck finding the prob & please let me know if there's any more info you need.

Cheers,

Ben

cpliakas’s picture

Status: Active » Needs review
StatusFileSize
new422 bytes

Thanks a lot. I have a small patch that may fix the issue.

shunting’s picture

Wouldn't have happened for me since I'm not using WAMP and I am using http://ftp.drupal.org/files/projects/luceneapi-6.x-1.2.tar.gz . Thanks, Chris and Ben!

shunting’s picture

Wouldn't have happened for me since I'm not using WAMP and I am using http://ftp.drupal.org/files/projects/luceneapi-6.x-1.2.tar.gz . Thanks, Chris and Ben!

ben_scott’s picture

Hey Chris -

Sorry for not getting back to you quicker about this - had loads of work on & I hadn't been able to test your patch. I just have done & it's now working perfectly - thanks so much for getting it sorted - & so quickly. And thanks again for the superb module.

Cheers,

Ben

cpliakas’s picture

Status: Needs review » Reviewed & tested by the community

Believe me, I understand with the work. I appreciate you taking the time to test it. I will commit it to the 1.0 branches, and it will be reflected in the 1.5 releases. Also, thanks to walker2238 for posting the initial bug report.

cpliakas’s picture

Status: Reviewed & tested by the community » Fixed

Fix committed in #250862, #250864. The change will be reflected in the 1.5 release. There will be no need to upgrade ZF components in this release, as the problem was with my code.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.