Closed (fixed)
Project:
Search 404
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Reporter:
Created:
21 Oct 2009 at 16:34 UTC
Updated:
18 Jul 2010 at 00:30 UTC
Using pathauto can often lead to having classifications of content where all the path does not match the content.
+ $keys = basename($keys);
would work better IMHO.
Comments
Comment #1
zyxware commentedWhere should I make this change in the code?
Is it for search404_get_keys() function?
Also can you give me an example of the above mentioned scenario so that I can understand it better?
Thank You
Regards
Santhosh Raju
Comment #2
sgriffin commentedA user hits a 404 path like http://www.domain.com/photography/architecture/exterior/roman_colliseum
So the key becomes the whole path, so if you moved this content to
http://www.domain.com/photography/travel/roman_colliseum
The search and redirect fails.
If you put the basename function on it and just search on "roman_colliseum", then everything works as expected.
function search404_get_keys() {
line 42
Comment #3
anoopjohn commentedMarking as active.
@sgriffin - Can't you just use a regular expression ([^\/]*\/)* for the PCRE filter and get the same effect?
But yes this feature might make sense as a simple checkbox for the user.
Comment #4
sgriffin commentedLOL. Quite possibly so if I was a regex expert.
However, for organized paths, it might make sense to fall back or ORS instead of ands to improve results.
By using a basename, for the last url I am stating that it is the only thing that is important and guaranteeing a proper redirect.
Im not exactly sure what it is searching on or if it is using and..
Is it doing a search for "photography && architecture && exterior && roman_colliseum"?
I think it's more logical to search for "photography || architecture || exterior || roman_colliseum"
In any case, I'm quite happy with this module, its a major benefit for drupal!
Thanks for the good work!
Comment #5
zyxware commentedThe module only passes on the keys to Drupal Search (or other search modules) to perform the actual search. There is already an option in the module to add OR operator in between the keywords. The default drupal search uses implicit AND between keywords.
Marking issue as fixed since the feature is already present in some form.