Hi Morgan

It comes down to the following questions:
- Do you want these columns/values treated as strings by Sphinx?
- Do you want people to be able to search for these values as free text?

It sounds like the answer to both of those questions is no, and so you want 
them to be attributes. What you're doing is what Sphinx calls filtering. It's 
not limiting certain query terms to fields, it's limiting results based on 
attribute values.

Does this make things a little clearer?

Cheers

-- 
Pat

On 11/11/2010, at 11:20 AM, Morgan Kay wrote:

> My database had several fields in it that are booleans and integers,
> and I'm not sure whether I should index them as fields or attributes.
> I want to be able to search on these fields, so maybe they need to be
> fields; but then again, they are integers and booleans, so maybe they
> should be attributes.
> 
> Here are some examples:
> 1) I have a field that determines whether a record is viewable by
> users who aren't logged in.  This is a boolean.  So if a user is not
> logged in, I plan to put a hidden_field_tag in my form that will add
> "public=true" to the parameters.
> 2) I have date fields that are integers.  The form will have "begin
> year" and "end year" fields so that users can search for records
> between certain years.
> 3) I have boolean fields that tell whether a record has been
> translated into English or not.  Users will be able to limit their
> search to records that have been translated.
> 
> In cases like these, is it best to index these fields as fields or
> attributes?
> 
> Thank you!
> Morgan.
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Thinking Sphinx" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to 
> [email protected].
> For more options, visit this group at 
> http://groups.google.com/group/thinking-sphinx?hl=en.
> 

-- 
You received this message because you are subscribed to the Google Groups 
"Thinking Sphinx" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/thinking-sphinx?hl=en.

Reply via email to