Hi Alessandro, thanks for the reply! I wasn’t aware of nested documents, as you say, it seems precisely what I need .. in fact it looks like I plagiarised that article while writing my description hehe. Upgrading from 4.10 is a bit of work but, might just be worth it.
Many Thanks! Douglas > On 5 Oct 2015, at 07:46, Alessandro Benedetti <benedetti.ale...@gmail.com> > wrote: > > Hi Douglas ! > Your use case is a really good fit for Nested Objects in Solr[1] > After you model your problem in nested objects, you should play a little > bit with faceting at different levels ( parent/children). > A pivot faceting can be good in some scenario, probably not in yours. > I would probably suggest to explain better how you want to search over your > documents. > After that you can think how to facet over the children. > > Cheers > > [1] http://yonik.com/solr-nested-objects/ > > 2015-10-02 17:48 GMT+01:00 Douglas McGilvray <d...@weemondo.com>: > >> Hi everyone, my first post to the list! I tried and failed to explain this >> on IRC, I hope I can do a better job here. >> >> My document has a group of text fields: company, location, year. The group >> can have multiple values and I would like to facet (drill down) beginning >> with any of the three fields. The order of the groups is not important. >> >> Example Doc1: >> {company1: Bolts, location1: NY, year1: 2002} >> {company2: Nuts, location2: SF, year2: 2010} >> >> If I select two filters: fq=company:Bolts && fq=location:SF, Doc1 should >> not be in the results, because although the two individual values occur in >> the document, they are not within the same group. >> >> Following the instructions for facet.prefix based drill down (the link >> will explain this far better than I can) >> >> https://wiki.apache.org/solr/HierarchicalFaceting#A.27facet.prefix.27__Based_Drill_Down >> I can create a custom field lets call it cly which represents a >> drill-down hierarchy company > location > year >> So For the document above it would contain the following: >> >> 0:Bolts >> 1:Bolts>NY >> 2:Bolts>NY>2002 >> 0:Nuts >> 1:Nuts>SF >> 2:Nuts>SF>2010 >> >> I can retrieve the facets for the Company using: facet.field={!key=company >> facet.prefix=“0:”}cly >> >> If the user selects the company Bolts, I can filter the values using: >> fq=cly:”0:Bolts” >> And I can retrieve the facets for the location using >> facet.field={!key=location facet.prefix=“1:Bolts”}cly >> >> This is fine if I want to drill down company location year, but what if, >> after selecting company I now want to select year? I make a field for each >> combination of values: cly, cyl, lyc ….. >> >> If the user selects Bolts, I can now retrieve the facets for year using >> facet.field={!key=year facet.prefix=“1:Bolts”}cyl (NB the order of the >> letters here) >> >> I hope the above makes sense, even if the idea itself is completely crazy. >> Obviously the number of extra fields is factorial. I cant believe I am the >> first person to want to do this type of search, which makes me think there >> is probably another (better) way to do this. Is there? >> >> King Regards and many thanks in advance, >> Douglas > > > > > -- > -------------------------- > > Benedetti Alessandro > Visiting card - http://about.me/alessandro_benedetti > Blog - http://alexbenedetti.blogspot.co.uk > > "Tyger, tyger burning bright > In the forests of the night, > What immortal hand or eye > Could frame thy fearful symmetry?" > > William Blake - Songs of Experience -1794 England