I hope I''m posting to the correct place, please excuse me if I''m not... and point me to the right place. Without passing a token to the autocompleter, with partial search and full search all active…. it seems only to find values where the search query is in the exact same order, for example “black case” typed into the text field will only find results that are exactly that, “black case” It seems to ignore “black rounded case” or anything that might have both words, but not in the exact order. If I tokenize the values then it searches for anything with “any” of the words, not for anything with both. Is there a way to have it do a search for “TermA” AND “TermB” ? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
FreakBoy a écrit :> If I tokenize the values then it searches for anything with “any” of > the words, not for anything with both. > > Is there a way to have it do a search for “TermA” AND “TermB” ?Yes, but the +tokens+ option is not designed for this: if you tokenize with whitespace, for instance, you''re basically completing only the current (last-edited) token, not completing based on all tokens. The default algorithm for local match, which implements partial and full search, does not suit your needs (split on whitespace and match any). That''s not its doc''d behavior. If you need such a behavior, you''ll have to pass a custom +selector+ option, which will have to re-implement any default match option you were passing. Check Scripty''s code in Autocompleter.Local, and how its +setOptions+ method defines the default +selector+ option for clues. ''HTH -- Christophe Porteneuve aka TDD tdd-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
On May 5, 5:29 pm, Christophe Porteneuve <t...-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org> wrote:> > If you need such a behavior, you''ll have to pass a custom +selector+ > option, which will have to re-implement any default match option you > were passing. Check Scripty''s code in Autocompleter.Local, and how its > +setOptions+ method defines the default +selector+ option for clues. > > ''HTH > > -- > Christophe Porteneuve aka TDD > t...-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.orgWould you happen to have a link that might help me in constructing the custom selector? I was afraid that was what was needed and I''m still fairly inexperienced in Javascript. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---