Highlighting and range queries

Hi there,

Is highlighting for range queries supposed to work ?
It doesn’t work here.

here is an non-working example: (highlighting works when q=“test:2007*”)

require ‘ferret’
include Ferret

index = Index::Index.new()
#index.field_infos.add_field(:test, :store => :yes, :index =>
:untokenized)

i=1
for a in [ “20070505”, “20071230”, “20060920”, “20081111” ]
index << {:id => i, :test => a}
i+=1
end

for q in [ ‘test:( >= 20070101)’, ‘test:2007*’,
Ferret::Search::RangeQuery.new(:test, :>= => “20070101”) ]
index.search_each(q) do |id, score|
puts “Document #{index[id][:test]} found with a score of #{score}”
highlights = index.highlight(q, id, :field => :test, :pre_tag =>
“\033[36m”, :post_tag => “\033[m”)
puts highlights
end
puts “------”
end

On Sun, Jun 17, 2007 at 05:40:48PM +0200, [email protected] wrote:

Hi there,

Is highlighting for range queries supposed to work ?
It doesn’t work here.

Your test doesn’t work for me, too - looks like highlighting is just not
yet implemented for RangeQueries…

Jens


Jens Krämer
webit! Gesellschaft für neue Medien mbH
Schnorrstraße 76 | 01069 Dresden
Telefon +49 351 46766-0 | Telefax +49 351 46766-66
[email protected] | www.webit.de

Amtsgericht Dresden | HRB 15422
GF Sven Haubold, Hagen Malessa