Development

#2873 (sf_highlight hard-coded in sfLuceneHelper.php)

You must first sign up to be able to contribute.

Ticket #2873 (closed defect: fixed)

Opened 8 months ago

Last modified 8 months ago

sf_highlight hard-coded in sfLuceneHelper.php

Reported by: Mark.Quezada Assigned to: Carl.Vondrick
Priority: minor Milestone:
Component: sfLucenePlugin Version: 1.0.10
Keywords: sf_highlight add_highlight_qs highlight query string Cc:
Qualification: Unreviewed

Description

sfLuceneHelper.php's add_highlight_qs() function builds its query string like so:

$query .= 'sf_highlight=' . implode($keywords, ' ') . $suffix;

Notice that 'sf_highlight' is hardcoded into the query string. This causes the highlighting to break if you've over-written this value in the filters.yml file with something like this:

highlight:
  class: sfLuceneHighlightFilter
  param:
    highlight_qs: highlight 

... since this is value is not respected in the add_highlight_qs() function (the highlighter looks for "highlight" while the query string is still using "sf_highlight"). I don't think it's possible (easily) to load the filters.yml params into another part of the application, so it may make more sense to put this value into the plugin's app.yml so that you can access it from both the filter and the helper. This way, the above function could be something like:

$query .= sfConfig::get('app_lucene_highlight_qs').'=' . implode($keywords, ' ') . $suffix;

... currently the only way around this is to manually define routes in routing.yml that re-map the sf_highlight to another name for the url.

Change History

02/03/08 11:28:44 changed by Mark.Quezada

  • status changed from new to closed.
  • resolution set to fixed.

Added the ability to define "highlight_qs" in app.yml in r7286 which fixes this issue.