I am interested in search results being displayed as this individual has been able to accomplish:
http://rotterdam.ics.uci.edu/drupal/?q=search/node/lucene
However, I don't want to have to use their hacked lucene to do it. Has anyone accomplished this, here on Drupal or is there a setting or configuration I am missing?
Having a context to the search terms is critical and highlighting the actual search terms is extremely important. Also, if there was a way to get the terms highlighted when the user hits the actual page from the search query, that would be awesome and extremely user friendly.
I use a piece of software called Zoom, by Wrensoft, that is able to do these things. I can certainly integrate the Zoom search engine into my site, and it will do what I am describing here. But, I am really trying to use the Lucene API, because I like it's integration into Drupal itself. I think in the long-run, it will be easier to maintain as well.
For an example of the idealistic search result display that I would love to achieve, you can check this out, on Wrensoft:
http://www.wrensoft.com/zoom/screen_images.html
and for a live view:
http://www.wrensoft.com/search.php?zoom_query=zoom&x=0&y=0
Thanks for your time. I am hoping to get the Lucene API really humming on my site!
Comments
Comment #1
milesw commentedApart from the filetype tricks that appear in screen #2, I think the module already does what you're talking about. Are you just looking to have contextual snippets and term highlighting? Did you enable the luceneapi_node module that comes with luceneapi?
Comment #2
ukrdrupal commentedmilesw, thanks for your response! I am glad if the feature is already available! I am interested to see.
I thought I had all of the lucene modules enabled. If you are talking about admin/settings/luceneapi_node, yes, I have it available to me, for settings. And I have sites/default/files/luceneapi_node set as the index path for the filesystem. Or did you mean something else?
I don't see how to change any setting for the context or highlight and I don't even get a context on the keyword, let alone highlight the term within the context.
Is there something I am missing? Thanks for your time and help!
Comment #3
milesw commentedMake sure the path you're using is: /search/luceneapi_node/
It's possible that your content isn't indexed correctly. Go to /admin/settings/luceneapi_node/statistics and make sure there's something in the index. The first field, 'contents', should contain a large number of terms.
If you're using a custom theme you could try switching back to Garland.
Those are all the ideas I've got!
Comment #4
ukrdrupal commentedmilesw, thanks again for replying! Yes, the path that is being used is /search/luceneapi_node/
Yes, I do have quite a lot there in the 'contents' field at /admin/settings/luceneapi_node/statistics
...I did try to switch off the custom theme, but this did not help.
Comment #5
cpliakas commentedHi ukrdrupal.
As milesw says, Search Lucene API does result highlighting out of the box. Still not exactly sure what you mean by "context", but looking at the examples it seems that the module does most of what you are looking to do without any additional coding or custom configuration. If you are not seeing this behavior, I would take a look and any custom code or contributed modules that might be conflicting with this module.
Regarding http://rotterdam.ics.uci.edu/drupal/?q=search/node/lucene, it doesn't look "hacked" to me in any way. Seems like a pretty standard implementation of the module. Do you have any additional insight you can share on this? Any additional information you can give would help in debugging your issue.
Thanks for posting,
Chris
Comment #6
ukrdrupal commentedChris, excellent to hear from you! ...I keep wondering if I am having problems with "context" around the search terms based on the fact that the site is in Ukrainian. Do you know anything about this, whether this may be a problem?
I plan to do work on a Ukrainian stemmer, since I don't see any has been written yet. But, I don't believe this will improve the issue. ...Do you know if the Drupal search or the Drupal lucene search has trouble picking up context with cyrillic sites?
...I probably should create a test site in English, with the same configurations that I have and then I will know if I have a problem with configuration. I would be able to give more information to you about possible conflicts. But, right now, I have more factors than just modules; like I said, the site is in Ukrainian.
As for the rotterdam.ics.uci.edu, please look at this:
http://rotterdam.ics.uci.edu/drupal/?q=node/11
http://rotterdam.ics.uci.edu/drupal/?q=node/18
His work does *look* similar, but apparently he is working with an additional module? and a hacked version of lucene. Did I misinterpret him? ...Looks like he is working with something Java based.
Regardless (it doesn't really matter about the rotterdam.ics.uci.edu because I was just trying to point to something as an example), what I need is the ability to show a larger context (more words) around the actual search term and I need the search term displaying in that text and I need it bold or highlighted, etc. This would mean that the search term would need to have a CSS class on it, so that I could modify the look easily.
And then if it was possible to have a jump to and highlight on the term (or terms), when someone clicks on one of the query results, that would be GREAT!!!
...I'll see what I can do here on my end, to set up an English site with the same configurations. Can someone chime in about the Ukrainian?
...Again, thank you Chris! It's a privilege to have your involvement. ...I watched your session from the San Francisco conference. Very cool! Good job!
P.S. - Where exactly do I tweak settings, for how many characters are around the search term in the search results? For instance, if I wanted to expand the context, how would I do that? Is there a setting somewhere?
Comment #7
cpliakas commentedukrdrupal,
It's a privilege to have you exploring the module :-). Thanks for the kind words about the presentation in SF.
I think I understand what you are getting at. First, thanks for the additional info on http://rotterdam.ics.uci.edu. After looking into it further, it seems that Chris Jensen is indeed using some custom stuff with Lucene, but he actually is not using Search Lucene API. Search Lucene API uses a PHP port of Lucene, which is how it is able to do the stuff that it does completely inside of Drupal. He is either using the core Search module or has extended it to use his modified Java Lucene judging by the post you mentioned. Either way, the results look exactly as Search Lucene API should look out of the box with no configuration.
Regarding how Lucene works, it uses an "analyzer" to parse the text. By default, the analyzer just takes the text as is and is UTF8 compatible, so it should work on a Ukranian site as well. I know for a fact Russian and Danish sites are using Search Lucene API without a problem. This does touch on the "expanding context" question. There is no setting for this, as it is the job of either the stemmer or through wildcard queries. For example, with an English stemmer searches for "test" will match and highlight "tests" and "testing". If you search for "te*", it will match and highlight "tent", "test", "temporary", etc.
In terms of highlighting, Search Lucene API **should** do that out of the box without a problem with no work on your part. There are no configuration options to make this happen. If it isn't working for you, there may be a conflict with another module, something with PHP may not be right, there may be a bug with SLAPI that nobody has picked up yet, etc. Unfortunately it will take some debugging on your part :-/.
Also, there is no "jump to and highlight" functionality as of yet. I am sure you can do this by extending the module as it has a lot of hooks you can implement to interact with the module, but it will have to be some custom work. Wouldn't seem too bad though with a little jQuery. Probably not too much work.
Hope this helps a bit,
Chris
Comment #8
cpliakas commented