Hi, Are you able to show some sample data to show what/how you're indexing your combined field? Your second search has a more detailed search string, which as far as I can tell from here should return fewer results.
James On Wed, Nov 4, 2009 at 12:11 PM, Alan <[email protected]> wrote: > > I'm not sure why, but it looks like this fails in some cases. Here is > an issue I am running into > > #attributes are "brand", "engine" and "transmission" > > str = 'brand Acura engine v6 ' > �...@facets = Product.facets :conditions=>{:combined=> > str, :is_published=>1} > �...@products = @facets.for > > #...@facets returns a count of 5 for "transmission auto" > > str = 'brand Acura engine v6 transmission auto' > �...@facets = Product.facets :conditions=>{:combined=> > str, :is_published=>1} > �...@products = @facets.for > > #...@products returns 2 vs the expected 5. > > I'm going to assume at this point, that this method just so "happens" > to work for you, but it doesn't seem like it works as a general > solution. I've tried different formats for the combined column, along > with different conditions strs but it looks likes it works ~80% of the > time. > > Anyone have ideas? Although this definitely feels like a "hack" if I > can get the last 20% working I have no issue with using this as a > solution(at least in the short term) > > > > > On Nov 3, 9:17 am, James Earl <[email protected]> wrote: >> Hi, >> >> What I meant by "search on one field, and get facets from another", >> was that when someone clicks on a facet, there's nothing that requires >> you to use that value on the same facet field. For example, if >> someone clicks on the color 'Brown', you don't have to pass it to the >> color field. >> >> Model.search(:conditions => {:color_size_width => 'Brown'}) >> >> Your facets are retrieved separately from the search. You don't even >> have to narrow your facets if you don't want to. >> >> Model.facets(:facets => [:color, :size, :width]) >> >> James >> >> On Tue, Nov 3, 2009 at 9:51 AM, Alan <[email protected]> wrote: >> >> > "search on one field, and get facets from another". I see the >> > approach... In my particular case its going to be difficult because my >> > actual data model has about 15 facets. Before I go down a road of >> > futility, I wanted to maintain a free text + facet search. If I now >> > use search as a combined-facet-string, I think I lose the ability to >> > do that correct? >> >> > On Nov 3, 7:50 am,JamesEarl<[email protected]> wrote: >> >> What you're wanting to do is should be possible within your Product >> >> index. It sounds similar to the problem I had? See my most recent >> >> post on indexing dependent columns. The one thing that helped me was >> >> to remember that you can search on one field, and get facets from >> >> another. You'd end up indexing not only 'color', 'size', and 'width', >> >> but also an addition field containing those fields joined together. >> >> You'd then search on the combined field, and facet on the individual >> >> fields. I'm just starting to test out this method. I'd be interested >> >> to know which way ends up working better for you. >> >> >>James >> >> >> On Oct 29, 1:22 pm, Alan <[email protected]> wrote: >> >> >> > Wondering how best to handle the following situation: >> >> >> > Product has many Shoe_Option(example class name to illustrate type of >> >> > data model) where shoe options have the attributes of color, size and >> >> > width. >> >> >> > I want to do a search on products that have shoe options that have >> >> > "brown" for color and "wide" for width. >> >> >> > If I define index at the Product level(attempting to find products >> >> > with children that match), my result set of products is off, because >> >> > it will match products that might not have a child option that has >> >> > both brown AND wide.... It will simply match if there is a one child >> >> > shoe option with "wide" and at least one other child shoe option with >> >> > "brown". >> >> >> > What I am really looking for is an individual Shoe Option with BOTH of >> >> > these attributes. >> >> >> > Ok, so the obvious next thought would be to define the index at the >> >> > Shoe Option. That's great except, that it return a list of Shoe >> >> > Options, when I want products... Obviously I can manipulate the TS >> >> > result set, but I would like to do this at a lower level so there >> >> > isn't unnecessary processing. >> >> >> > Anyone have tips on how to do this with TS? Let me know if my example >> >> > is not clear... > > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
