Jens Kraemer wrote:
> Hi!
>
> Just to rule out the possibility of aaf being the culprit here, could
> you try your queries using Ferret directly on the index? Shut down your
> app and the DRb server before, just to be sure ;-)
>
Sure
> Then you could also try to use the sort API instead of string sort
> (check out the Sort and SortField classes in Ferret's API).
Good suggestion. Sort with a string is still broken when I use ferret
directly. Sort with auto type is as well:
total_hits =
fidx.search_each("marathon",:sort=>Ferret::Search::Sort.new([Ferret::Search::SortField.new(:city_for_sort)]),:offset=>400)
do |hit,score|
?> doc = fidx[hit]
>> results << doc[:id]
>> end
=> 1887
>> Event.find(results).map(&:city_for_sort)
=> ["ocean shores", "austin", "boca raton", "sauvie island", "crested
butte", "austin", "portland", "avery", "leadville", "houston"]
However, when I specify a string sort, that seems to fix it:
>> Event.find(results).map(&:city_for_sort)
=> ["bellevue", "baton rouge", "basalt", "bend", "bellevue", "bedford",
"bend", "berlin", "berlin", "beijing, china"]
>> total_hits =
>> fidx.search_each("marathon",:sort=>Ferret::Search::Sort.new([Ferret::Search::SortField.new(:city_for_sort,:type=>:string)]),:offset=>400)
>> do |hit,score|
?> doc = fidx[hit]
>> results << doc[:id]
>> end
=> 1887
There were some fields with the text "0". I wonder if it was guessing
the wrong type of index? I cleaned up that data and I'm rebuilding the
index now.
[snip]
>
>
> Jens
>
--
Posted via http://www.ruby-forum.com/.
_______________________________________________
Ferret-talk mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/ferret-talk