Closed (fixed)
Project:
Apache Solr Search
Version:
7.x-1.x-dev
Component:
Code
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
8 Mar 2011 at 14:32 UTC
Updated:
5 Dec 2011 at 17:32 UTC
Whenever I use quotes in a search I get zero results. If I search normally without quotes it works perfectly.
I.E. if i search for "social" i get zero results. If I search for social (without quotes) it works as expected.
This means that searching for a phrase is impossible.
I've tested with different keywords and phrases and it does not matter if it's used in a title, body, taxonomy etc.
To see the bug in action you can go to: http://new-compass.net/
Try searching for keywords from some of the articles there like "social ecology"
Comments
Comment #1
pwolanin commentedWhy do you think a phrase search should work? dismax doesn't handle phrase searches.
Comment #2
olax commentedThree reasons I assumed that phrase search would work:
1. It works in the Drupal 6 version.
2. The "no result"-page still mentions phrased search as a option.
3. Apache Solr Search Integration's own "Did you mean" function still suggests phrased searches.
Is phrase search something that will be possible through the version 7 branch of Apache Solr Search Integration in the future?
Comment #3
pwolanin commentedWe recently made some changes to handling of quote characters to avoid seeing escaped html entities in the search results. It's possible that's the cause. Can you try with the latest 6.x-1.x-dev version?
Comment #4
pwolanin commentedIndeed, look in apachesolr_do_query() I changed that in drupal 7 in the commit below. Looking at the dismax docs, I guess we need to revise this.
The original issue is #528086: html entities are not properly handled on search/display
Comment #5
pwolanin commentedLet's consider the issue there, and close this as a dup.
Comment #6
pwolanin commentedsee: http://drupal.org/node/528086#comment-4204790
Comment #7
olax commentedThis problem occurs in the 7-version of the module, not in 6.
Comment #8
pwolanin commentedWell, it would have occurred in 6.x HEAD before the fix in http://drupal.org/node/528086 - did you try it?
Comment #10
mac_weber commentedI'm using 7.x-1.0-beta5 and I'm still getting no results and no search suggestion for searches using double quotes "like this". If I do the same search using 'single quotes' I get a search suggestion and no results.
Comment #11
pwolanin commentedThe single quotes will not so anything useful - really they will match as an apostrophe basically.
The double quotes work fine for me in the latest 7.x-1.x, so I'd need more detail or need you to test on the latest code to see if the problem is still present.
the beta6 release should be out soon.
Comment #12
mac_weber commentedI just switched to 7.x-1.x-dev to test if it is regarding versions.
I uninstalled the old module, I deleted the whole folder.
Then I downloaded again, did not copy the xml files to solr as they look to be the sames as from Beta5, and enabled the module.
On the -dev version I still cannot use double quotes, but instead of just no results it returns an error messge: "The Apache Solr search engine is not available. Please contact your site administrator."
I THINK it may be caused because I'm using multicore solr. My solr server URL was http://localhost:8082/solr/test1 I changed my server to be on http://localhost:8983/solr/test1, but I got the same error. I think in some part of the module apachesolr code it may be looking for something like "http://localhost:8983/solr", without the core on the end, in this case "test1". Again, I'm not sure about it, and it only happens on searches using double quotes.
Another problem I just noticed (probably not related to this bug, but just in case...) is that the search is done based on relevancy. When I click on other kind of sorting methods they work fine. When I try to sort by relevancy again it is not changing how the results are sorted.
Comment #13
pwolanin commentedI cannot reproduce the quote issue locally - please provide some more details: Solr version, servlet container, etc.
Created a separate issue for the sort block bug: #1148612: Clicking "Relevancy" has no effect after choosing another sort.
Comment #14
mac_weber commentedThe problem was on the solr installation.
Do NOT use ubuntu packages to install solr or sorl-jetty. Do NOT download the solr php integration if you are going to install it on Drupal 7(I think it should be on the README). -Thanks pwolanin for helping me to fix it!
As suggested by pwolanin, I did the installation without packages, I did not use tomcat/jetty. I used the start.jar included in solr, making things simpler. I did a multicore installation that looks to be working fine.
Many guides on the internet and drupal.org instructs to install the solr-php library. As it was included in the module from D6 to D7 version I think it should be cited there. Also, from beta5 to beta6 it changed the faceted blocks, now you need to download the Facet API module to make it work (it also needs to be cited on the README).
Comment #15
pwolanin commentedstart.jar actually runs Jetty which is included with the Solr install (and they use it for testing Solr) - the packages often have wonky configuration.
Comment #16
pwolanin commentedComment #17
pwolanin commentedActually we should put this back to closed and have another issue for the README changes.
see: http://drupal.org/node/1150962
Comment #18
plamondonl commentedPhrase search not working is indeed a Solr installation problem, not a problem with apachesolr module code nor DisMax handler. I installed Solr from the Ubuntu 10.04 package and I had to do the following in order to make phrase search work:
cd /usr/share/solr/WEB-INF/lib
sudo ln -s ../../../java/lucene-memory.jar
At some point, Solr requires org/apache/lucene/index/memory/MemoryIndex class to be loaded but its .jar wasn't included by default by my package configuration. I've read somewhere that it's phrase highlighting rather than phrase search that needs this class, but I didn't verify.
Comment #19
mac_weber commented@plamondoni as stated in #14, you shoud NOT use the ubuntu packages. This was my mistake.
Follow the new README on the module to install solr, @pwolanin included it on the instructions.
edit: In addition, I did not do anything about memory, nor anything besides what it is written on the new README