On Feb 9, 2007, at 6:28 PM, jen wrote:

> I have a field named 'title'.
> If I tokenize this field then I'm able to search it by keywords but  
> not
> able to sort it.   However if I untokenize so that sorting works, then
> the search fails.
>
> Its a dilemma but I'm sure there must be some solution to this  
> problem,
> right?
>
> It can't be that for any particular field I have to choose between
> whether I want to search it or sort by it.

What about

FieldInfo.new(:title, :index => :yes, :store => yes)

This should store the field in it's original format while indexing it  
tokenized.

If this doesn't work, I'd consider it a bug since the documentation  
suggests that :store and :index are independent options. At least, it  
doesn't state otherwise. Setting a certain value for :store should  
not conflict or interfere with any value for :index.

If this is indeed not working as expected, you could use two fields,  
one which you store untokenized (for sorting) and one which you don't  
store but index tokenized. That'd wouldn't be an elegant solution but  
a feasible one.

Cheers,
Andreas

_______________________________________________
Ferret-talk mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/ferret-talk

Reply via email to