Hey David,

thanks for the answer ..

> How about setting the boost for the whole document rather than just
> the :relevance field? Or do you sometimes want to sort by relevance
> without taking the :relevance field into account?

ah.. you mean i should boost each field of the document? or is there a 
way to set a boost level for the document as a whole? if so, i've missed 
it ..

> PS: While we are on the topic, how would you like the sort API to
> look? Many have complained that the sort API is too java-like but
> no-one has suggested any improvements yet. I'd love to see some ideas.

i like the idea of giving a short block with a sort algorithm.. i would 
like to see something like that:

index.search ( :query => my_query,
               :sort  => Proc.new( |doc| # some caluclation; return 
new_score ),
               :reverse => false,
               :filter => false,
               :start => 0,
               :limit => 10 )

alternativly you should be able to give the sort param a name of a 
filed, like ':sort => :score' or an array of fields like ':sort => [ 
:score, :title ]' and sort by the first element and then by the 2nd if 
the two or more docs share the same value for the 1st element.
I guess something like ":sort => :score" is enough for most people ..

i think the other options are almost like it is implemented right now .. 
i don't think you nee the SortField class.

btw.. i do find the filter API not really intuitive, actually i didn't 
understand it at all ;)

i know what you want to do with filters and how you want to get there, 
but i haven't found any understandable documentation, on how to build 
one ..

maybe you should write a short tutorial on how to write a filter.. i 
would find it very intuitive, to have something like a base_query.. like 
having one query to filter/limit results, and have another query to do 
the real search..

and btw.. one feature i would definitely would like to see is to limit 
the search on a number of fields..

i know i can write something like

field_one:"search string" || field_two:"search 
string||field_three:"search string"||field_four:"search string"

but i would like to be able to write something like

(field_one|field_two|field_three|field_four):"search string"

furthermore, you should be able to say something like .. search in all 
fields, except field_one .. like

(*|!field_one):"search string"

Ben

-- 
Posted via http://www.ruby-forum.com/.
_______________________________________________
Ferret-talk mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/ferret-talk

Reply via email to