Details

    • Type: New Feature New Feature
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: 4.9, 5.0
    • Component/s: search
    • Labels:
      None

      Description

      Strict Facet Hierarchies... each tag has at most one parent (a tree).

      1. SOLR-64.patch
        13 kB
        Koji Sekiguchi
      2. SOLR-64.patch
        13 kB
        Erik Hatcher
      3. SOLR-64.patch
        14 kB
        Thibaut Lassalle
      4. SOLR-64.patch
        37 kB
        Benjamin Armintor
      5. SOLR-64_3.1.0.patch
        16 kB
        Relephant

        Issue Links

          Activity

          Uwe Schindler made changes -
          Fix Version/s 4.9 [ 12326731 ]
          Fix Version/s 5.0 [ 12321664 ]
          Fix Version/s 4.8 [ 12326254 ]
          Hide
          Uwe Schindler added a comment -

          Move issue to Solr 4.9.

          Show
          Uwe Schindler added a comment - Move issue to Solr 4.9.
          Hide
          David Smiley added a comment -

          Nowadays, people get hierarchical faceting via either Pivot Faceting (easiest) or via a little bit of clever tokenization with facet.prefix as described by Grant's recent article which is similar if not the same as described in the wiki by Hoss. I do think there's a need for built-in hierarchical faceting, if for nothing else but ease of use by users, but I'm skeptical it's with the code in SOLR-64. Ales, can you tell us why those approaches are unsuitable?

          Show
          David Smiley added a comment - Nowadays, people get hierarchical faceting via either Pivot Faceting (easiest) or via a little bit of clever tokenization with facet.prefix as described by Grant's recent article which is similar if not the same as described in the wiki by Hoss. I do think there's a need for built-in hierarchical faceting, if for nothing else but ease of use by users, but I'm skeptical it's with the code in SOLR-64 . Ales, can you tell us why those approaches are unsuitable?
          Hide
          Ales Perme added a comment -

          Hi Guys!
          Just a question and an offer. For how much (EUR or USD) would anyone be prepared to develop and push this functionality into SOLR main trunk?

          Please contact me personally at ales.perme(AT)bolha.com

          TNX!

          Show
          Ales Perme added a comment - Hi Guys! Just a question and an offer. For how much (EUR or USD) would anyone be prepared to develop and push this functionality into SOLR main trunk? Please contact me personally at ales.perme(AT)bolha.com TNX!
          Hide
          Olivier Terrier added a comment -

          Thank you for this e-mail.

          I'm currently out of the office and have sporadic access to my e-mails.

          For any urgent matter, please contact Christian Lautier (christian.lautier@temis.com<christophe.aubry@temis.com>). Otherwise, I will get back to you on March 17th.

          Best Regards,
          Olivier Terrier

          Show
          Olivier Terrier added a comment - Thank you for this e-mail. I'm currently out of the office and have sporadic access to my e-mails. For any urgent matter, please contact Christian Lautier (christian.lautier@temis.com< christophe.aubry@temis.com >). Otherwise, I will get back to you on March 17th. Best Regards, Olivier Terrier
          David Smiley made changes -
          Fix Version/s 4.8 [ 12326254 ]
          Fix Version/s 4.7 [ 12325573 ]
          Hide
          Ales Perme added a comment -

          Hi Guys. Is there any news on this patch/functionality? It is being pushed from one version to another, regardless it is marked as "Major" and a lot of votes. Is there any viable, performance efficient alternative to this kind of hierarchical facet? Thank you for your reply...

          Show
          Ales Perme added a comment - Hi Guys. Is there any news on this patch/functionality? It is being pushed from one version to another, regardless it is marked as "Major" and a lot of votes. Is there any viable, performance efficient alternative to this kind of hierarchical facet? Thank you for your reply...
          Uwe Schindler made changes -
          Fix Version/s 4.7 [ 12325573 ]
          Fix Version/s 4.6 [ 12325000 ]
          Adrien Grand made changes -
          Fix Version/s 4.6 [ 12325000 ]
          Fix Version/s 5.0 [ 12321664 ]
          Fix Version/s 4.5 [ 12324743 ]
          Hide
          Cohen, Mark - MTS added a comment -

          I'm out August 23rd-September 3rd.

          Show
          Cohen, Mark - MTS added a comment - I'm out August 23rd-September 3rd.
          Hide
          Bill Bell added a comment -

          This is plus 2 years old... Are we fixing it?

          Show
          Bill Bell added a comment - This is plus 2 years old... Are we fixing it?
          Steve Rowe made changes -
          Fix Version/s 5.0 [ 12321664 ]
          Fix Version/s 4.5 [ 12324743 ]
          Fix Version/s 4.4 [ 12324324 ]
          Hide
          Steve Rowe added a comment -

          Bulk move 4.4 issues to 4.5 and 5.0

          Show
          Steve Rowe added a comment - Bulk move 4.4 issues to 4.5 and 5.0
          Uwe Schindler made changes -
          Fix Version/s 4.4 [ 12324324 ]
          Fix Version/s 4.3 [ 12324128 ]
          Gavin made changes -
          Link This issue depends upon SOLR-1057 [ SOLR-1057 ]
          Gavin made changes -
          Link This issue depends on SOLR-1057 [ SOLR-1057 ]
          Robert Muir made changes -
          Fix Version/s 4.3 [ 12324128 ]
          Fix Version/s 5.0 [ 12321664 ]
          Fix Version/s 4.2 [ 12323893 ]
          Mark Miller made changes -
          Fix Version/s 4.2 [ 12323893 ]
          Fix Version/s 5.0 [ 12321664 ]
          Fix Version/s 4.1 [ 12321141 ]
          Robert Muir made changes -
          Fix Version/s 4.1 [ 12321141 ]
          Fix Version/s 4.0 [ 12314992 ]
          Koji Sekiguchi made changes -
          Assignee Koji Sekiguchi [ koji ]
          Hide
          Manuel added a comment - - edited

          I've applied the patch to the latest 3.x branch and it's working great for solr itself.
          However, solrj fails when it tries to parse the facets.
          java.lang.ClassCastException: org.apache.solr.common.util.NamedList cannot be cast to java.lang.Number
          at org.apache.solr.client.solrj.response.QueryResponse.extractFacetInfo(QueryResponse.java:212)

          Any chance, this patch can be updated to support solrj as well?

          Show
          Manuel added a comment - - edited I've applied the patch to the latest 3.x branch and it's working great for solr itself. However, solrj fails when it tries to parse the facets. java.lang.ClassCastException: org.apache.solr.common.util.NamedList cannot be cast to java.lang.Number at org.apache.solr.client.solrj.response.QueryResponse.extractFacetInfo(QueryResponse.java:212) Any chance, this patch can be updated to support solrj as well?
          Relephant made changes -
          Attachment SOLR-64_3.1.0.patch [ 12476253 ]
          Relephant made changes -
          Attachment SOLR-64_3.1.0.diff [ 12476251 ]
          Relephant made changes -
          Attachment SOLR-64_3.1.0.diff [ 12476251 ]
          Hide
          Relephant added a comment - - edited

          Hi all, we have just tried to apply solr-64 to 3.1. Attached "SOLR-64_3.1.0.patch".

          Hope that helps.

          Show
          Relephant added a comment - - edited Hi all, we have just tried to apply solr-64 to 3.1. Attached " SOLR-64 _3.1.0.patch". Hope that helps.
          Robert Muir made changes -
          Fix Version/s 4.0 [ 12314992 ]
          Fix Version/s 3.1 [ 12314371 ]
          Hide
          Robert Muir added a comment -

          Moving out non-bug, non-test, unassigned issues from 3.1

          see http://www.lucidimagination.com/search/document/e5618bfdbfa8dcf6

          Show
          Robert Muir added a comment - Moving out non-bug, non-test, unassigned issues from 3.1 see http://www.lucidimagination.com/search/document/e5618bfdbfa8dcf6
          Hide
          Koji Sekiguchi added a comment -

          Let's push this to 3.1 without distributed support.

          Show
          Koji Sekiguchi added a comment - Let's push this to 3.1 without distributed support.
          Koji Sekiguchi made changes -
          Assignee Koji Sekiguchi [ koji ]
          Fix Version/s 3.1 [ 12314371 ]
          Fix Version/s Next [ 12315093 ]
          Koji Sekiguchi made changes -
          Link This issue depends on SOLR-1057 [ SOLR-1057 ]
          Hide
          Peter Karich added a comment -

          @SolrFan and @Mats:

          you could try an alternative solution:
          http://lucene.472066.n3.nabble.com/multi-level-faceting-tp1629650p1672083.html

          Show
          Peter Karich added a comment - @SolrFan and @Mats: you could try an alternative solution: http://lucene.472066.n3.nabble.com/multi-level-faceting-tp1629650p1672083.html
          Hide
          Kevin MacClay added a comment -

          I am currently out of the office. I will be returning on Monday, August 16.

          Kevin MacClay

          Show
          Kevin MacClay added a comment - I am currently out of the office. I will be returning on Monday, August 16. Kevin MacClay
          Hide
          Mats Bolstad added a comment -

          Are there any plans to update this to trunk? Would be much appreciated

          Show
          Mats Bolstad added a comment - Are there any plans to update this to trunk? Would be much appreciated
          Hide
          Aleksander Stensby added a comment -

          I'm currently on holidays until July 27.

          If urgent, please contact Gisele O'Connor:
          email: gisele.o.connor@integrasco.com
          phone: +47 90283809

          Best regards,
          Aleksander


          Aleksander M. Stensby
          Integrasco A/S
          E-mail: aleksander.stensby@integrasco.com
          Tel.: +47 41 22 82 72
          www.integrasco.com
          http://twitter.com/Integrasco
          http://facebook.com/Integrasco

          Please consider the environment before printing all or any of this e-mail

          Show
          Aleksander Stensby added a comment - I'm currently on holidays until July 27. If urgent, please contact Gisele O'Connor: email: gisele.o.connor@integrasco.com phone: +47 90283809 Best regards, Aleksander – Aleksander M. Stensby Integrasco A/S E-mail: aleksander.stensby@integrasco.com Tel.: +47 41 22 82 72 www.integrasco.com http://twitter.com/Integrasco http://facebook.com/Integrasco Please consider the environment before printing all or any of this e-mail
          Hide
          SolrFan added a comment -

          Can the patch please be updated to the latest trunk? Thanks

          Show
          SolrFan added a comment - Can the patch please be updated to the latest trunk? Thanks
          Hoss Man made changes -
          Fix Version/s Next [ 12315093 ]
          Fix Version/s 1.5 [ 12313566 ]
          Hide
          Hoss Man added a comment -

          Bulk updating 240 Solr issues to set the Fix Version to "next" per the process outlined in this email...

          http://mail-archives.apache.org/mod_mbox/lucene-dev/201005.mbox/%3Calpine.DEB.1.10.1005251052040.24672@radix.cryptio.net%3E

          Selection criteria was "Unresolved" with a Fix Version of 1.5, 1.6, 3.1, or 4.0. email notifications were suppressed.

          A unique token for finding these 240 issues in the future: hossversioncleanup20100527

          Show
          Hoss Man added a comment - Bulk updating 240 Solr issues to set the Fix Version to "next" per the process outlined in this email... http://mail-archives.apache.org/mod_mbox/lucene-dev/201005.mbox/%3Calpine.DEB.1.10.1005251052040.24672@radix.cryptio.net%3E Selection criteria was "Unresolved" with a Fix Version of 1.5, 1.6, 3.1, or 4.0. email notifications were suppressed. A unique token for finding these 240 issues in the future: hossversioncleanup20100527
          Benjamin Armintor made changes -
          Attachment SOLR-64.patch [ 12438443 ]
          Hide
          Benjamin Armintor added a comment -

          If token streams are being re-used, the token streams produced by the HierarchicalTokenFilterFactory need to respond to being reset().

          In particular, the StringBuilder it uses to build the facet values needs to be cleared on reset. I'm attaching a patch that resets the StringBuilder and the delegate TokenStream. It also includes some junit tests that cover a basic hierarchical facet search, and the handling of facet.depth and facet.prefix. It builds and tests against trunk rev 921562. I think this fixes the 1.4 issue.

          Show
          Benjamin Armintor added a comment - If token streams are being re-used, the token streams produced by the HierarchicalTokenFilterFactory need to respond to being reset(). In particular, the StringBuilder it uses to build the facet values needs to be cleared on reset. I'm attaching a patch that resets the StringBuilder and the delegate TokenStream. It also includes some junit tests that cover a basic hierarchical facet search, and the handling of facet.depth and facet.prefix. It builds and tests against trunk rev 921562. I think this fixes the 1.4 issue.
          Hide
          Jayendra Patil added a comment -

          Facing the Same Issue ... Tried to debug it further .. . seems more of an Lucene Issue rather than Solr.
          Tried it through Luke as well selecting the Documents tab, Browse the Term and clicking the Next term produces the same result as mentioned above in the issue.
          The DirectoryReader class seems to return the extended Intermingled values.

          Show
          Jayendra Patil added a comment - Facing the Same Issue ... Tried to debug it further .. . seems more of an Lucene Issue rather than Solr. Tried it through Luke as well selecting the Documents tab, Browse the Term and clicking the Next term produces the same result as mentioned above in the issue. The DirectoryReader class seems to return the extended Intermingled values.
          Hide
          Wadim Kruse added a comment -

          I am getting the same results as Anil, Lesiak and Thomas applying the SOLR-64.patch from 08.01.2010 to release-1.4.0 (r834197) and branch-1.4.0 (834467).

          http://old.nabble.com/Strict-Hierarchical-Facets-%28SOLR-64%29-td27612209.html

          Show
          Wadim Kruse added a comment - I am getting the same results as Anil, Lesiak and Thomas applying the SOLR-64.patch from 08.01.2010 to release-1.4.0 (r834197) and branch-1.4.0 (834467). http://old.nabble.com/Strict-Hierarchical-Facets-%28SOLR-64%29-td27612209.html
          Thibaut Lassalle made changes -
          Attachment SOLR-64.patch [ 12429758 ]
          Hide
          Thibaut Lassalle added a comment -

          Update to apply cleanly against release 1.4

          Show
          Thibaut Lassalle added a comment - Update to apply cleanly against release 1.4
          Thibaut Lassalle made changes -
          Hide
          Thomas Traeger added a comment -

          Hi,

          I'm also struggling with this problem and tried to investigate further. Found no solution so far but at least discovered the latest revsision where this patch worked: 804700.

          In the next change (804726) yonik commented: "SOLR-1353: Implement and use reusable token streams for analysis":

          http://svn.apache.org/viewvc?view=revision&revision=804726

          Does this help anyone?

          Show
          Thomas Traeger added a comment - Hi, I'm also struggling with this problem and tried to investigate further. Found no solution so far but at least discovered the latest revsision where this patch worked: 804700. In the next change (804726) yonik commented: " SOLR-1353 : Implement and use reusable token streams for analysis": http://svn.apache.org/viewvc?view=revision&revision=804726 Does this help anyone?
          Hide
          Lesiak Rémy added a comment -

          Hi all,

          I use the the Solr version 1.4-dev.
          I want to apply this patch, but I have an error on the class SimpleFacet during the patch.
          I have apply the patch manually. After I want reproduce the example of this page, but I obtained this result :
          "facet_counts":{
          "facet_queries":{},
          "facet_fields":{
          "hiefacet_h":[
          "sub_facets",[
          "A",1,
          "path-A","A/",
          "sub_facets",[
          "B",1,
          "path-B","A/B/",
          "sub_facets",[
          "E",1,
          "path-E","A/B/E/",
          "sub_facets",[
          "B",1,
          "path-B","A/B/E/B/",
          "sub_facets",[
          "B",1,
          "path-B","A/B/E/B/B/",
          "sub_facets",[
          "D",1,
          "path-D","A/B/E/B/B/D/",
          "sub_facets",[
          "E",1,
          "path-E","A/B/E/B/B/D/E/",
          "sub_facets",[
          "A",1,
          "path-A","A/B/E/B/B/D/E/A/",
          "sub_facets",[
          "B",1,
          "path-B","A/B/E/B/B/D/E/A/B/",
          "sub_facets",[
          "E",1,
          "path-E","A/B/E/B/B/D/E/A/B/E/",
          "sub_facets",[
          "A",1,
          "path-A","A/B/E/B/B/D/E/A/B/E/A/",
          "sub_facets",[
          .... etc

          Show
          Lesiak Rémy added a comment - Hi all, I use the the Solr version 1.4-dev. I want to apply this patch, but I have an error on the class SimpleFacet during the patch. I have apply the patch manually. After I want reproduce the example of this page, but I obtained this result : "facet_counts":{ "facet_queries":{}, "facet_fields":{ "hiefacet_h":[ "sub_facets",[ "A",1, "path-A","A/", "sub_facets",[ "B",1, "path-B","A/B/", "sub_facets",[ "E",1, "path-E","A/B/E/", "sub_facets",[ "B",1, "path-B","A/B/E/B/", "sub_facets",[ "B",1, "path-B","A/B/E/B/B/", "sub_facets",[ "D",1, "path-D","A/B/E/B/B/D/", "sub_facets",[ "E",1, "path-E","A/B/E/B/B/D/E/", "sub_facets",[ "A",1, "path-A","A/B/E/B/B/D/E/A/", "sub_facets",[ "B",1, "path-B","A/B/E/B/B/D/E/A/B/", "sub_facets",[ "E",1, "path-E","A/B/E/B/B/D/E/A/B/E/", "sub_facets",[ "A",1, "path-A","A/B/E/B/B/D/E/A/B/E/A/", "sub_facets",[ .... etc
          Hide
          Anıl Çetin added a comment -

          Sorry I couldn't explain it I think;

          for:
          a_level1/a_level2/a_level3/a_level4
          and
          b_level1/b_level2/b_level3/b_level4

          result:
          a_level1
          --> a_level1/a_level2
          ------> a_level1/a_level2/a_level3
          -----------> a_level1/a_level2/a_level3/level4

          b_level1/a_level1/a_level2/a_level3/level4
          --> b_level1 / b_level2 / a_level1/a_level2/a_level3/level4
          ------> b_level1/b_level2/b_level3/ a_level1/a_level2/a_level3/level4
          -----------> b_level1/b_level2/b_level3/b_level4/a_level1/a_level2/a_level3/level4

          Actually it mixes the fields. Also, in some indexes (I don't know what causes/why) it gives error

          HTTP Status 500 - null java.lang.StackOverflowError at java.nio.DirectByteBuffer.get(DirectByteBuffer.java:242) at java.nio.HeapByteBuffer.put(HeapByteBuffer.java:209) at sun.nio.ch.IOUtil.read(IOUtil.java:227) at sun.nio.ch.FileChannelImpl.read(FileChannelImpl.java:663) at org.apache.lucene.store.NIOFSDirectory$NIOFSIndexInput.readInternal(NIOFSDirectory.java:161) at org.apache.lucene.store.BufferedIndexInput.refill(BufferedIndexInput.java:157) at org.apache.lucene.store.BufferedIndexInput.readByte(BufferedIndexInput.java:38) at org.apache.lucene.store.IndexInput.readVInt(IndexInput.java:80) at org.apache.lucene.index.SegmentTermDocs.readNoTf(SegmentTermDocs.java:166) at org.apache.lucene.index.SegmentTermDocs.read(SegmentTermDocs.java:139) at org.apache.solr.search.SolrIndexSearcher.getDocSetNC(SolrIndexSearcher.java:685) at org.apache.solr.search.SolrIndexSearcher.getPositiveDocSet(SolrIndexSearcher.java:595) at org.apache.solr.search.SolrIndexSearcher.getPositiveDocSet(SolrIndexSearcher.java:585) at org.apache.solr.search.SolrIndexSearcher.numDocs(SolrIndexSearcher.java:1514) at org.apache.solr.request.SimpleFacets.getHierarchicalFacetCounts(SimpleFacets.java:619) at org.apache.solr.request.SimpleFacets.getHierarchicalFacetCounts(SimpleFacets.java:641) at
          ...............
          ......
          org.apache.solr.request.SimpleFacets.getHierarchicalFacetCounts(SimpleFacets.java:641)

          Show
          Anıl Çetin added a comment - Sorry I couldn't explain it I think; for: a_level1/a_level2/a_level3/a_level4 and b_level1/b_level2/b_level3/b_level4 result: a_level1 --> a_level1/a_level2 ------> a_level1/a_level2/a_level3 -----------> a_level1/a_level2/a_level3/level4 b_level1/a_level1/a_level2/a_level3/level4 --> b_level1 / b_level2 / a_level1/a_level2/a_level3/level4 ------> b_level1/b_level2/b_level3/ a_level1/a_level2/a_level3/level4 -----------> b_level1/b_level2/b_level3/b_level4/a_level1/a_level2/a_level3/level4 Actually it mixes the fields. Also, in some indexes (I don't know what causes/why) it gives error HTTP Status 500 - null java.lang.StackOverflowError at java.nio.DirectByteBuffer.get(DirectByteBuffer.java:242) at java.nio.HeapByteBuffer.put(HeapByteBuffer.java:209) at sun.nio.ch.IOUtil.read(IOUtil.java:227) at sun.nio.ch.FileChannelImpl.read(FileChannelImpl.java:663) at org.apache.lucene.store.NIOFSDirectory$NIOFSIndexInput.readInternal(NIOFSDirectory.java:161) at org.apache.lucene.store.BufferedIndexInput.refill(BufferedIndexInput.java:157) at org.apache.lucene.store.BufferedIndexInput.readByte(BufferedIndexInput.java:38) at org.apache.lucene.store.IndexInput.readVInt(IndexInput.java:80) at org.apache.lucene.index.SegmentTermDocs.readNoTf(SegmentTermDocs.java:166) at org.apache.lucene.index.SegmentTermDocs.read(SegmentTermDocs.java:139) at org.apache.solr.search.SolrIndexSearcher.getDocSetNC(SolrIndexSearcher.java:685) at org.apache.solr.search.SolrIndexSearcher.getPositiveDocSet(SolrIndexSearcher.java:595) at org.apache.solr.search.SolrIndexSearcher.getPositiveDocSet(SolrIndexSearcher.java:585) at org.apache.solr.search.SolrIndexSearcher.numDocs(SolrIndexSearcher.java:1514) at org.apache.solr.request.SimpleFacets.getHierarchicalFacetCounts(SimpleFacets.java:619) at org.apache.solr.request.SimpleFacets.getHierarchicalFacetCounts(SimpleFacets.java:641) at ............... ...... org.apache.solr.request.SimpleFacets.getHierarchicalFacetCounts(SimpleFacets.java:641)
          Hide
          Erik Hatcher added a comment -

          that's the current design of this feature, as shown by the examples above.

          Show
          Erik Hatcher added a comment - that's the current design of this feature, as shown by the examples above.
          Hide
          Anıl Çetin added a comment -

          Hi all,

          I applied the patch to solr nightly (solr-2009-10-14.zip) it compiles but results are somehow broken. It concatenates results recursively;

          for: level1/level2/level3/level4

          Expected Result:

          level1
          --> level2
          ------> level3
          -----------> level4

          But it becomes:

          level1
          --> level1/level2
          ------> level1/level2/level3
          -----------> level1/level2/level3/level4

          There may be a method changed, any idea?

          Show
          Anıl Çetin added a comment - Hi all, I applied the patch to solr nightly (solr-2009-10-14.zip) it compiles but results are somehow broken. It concatenates results recursively; for: level1/level2/level3/level4 Expected Result: level1 --> level2 ------> level3 -----------> level4 But it becomes: level1 --> level1/level2 ------> level1/level2/level3 -----------> level1/level2/level3/level4 There may be a method changed, any idea?
          Hide
          Erik Hatcher added a comment -

          Would it make sense to leverage payloads for level pruning? Encode the int level number as a payload and use that at search/faceting time - any advantages to that?

          Show
          Erik Hatcher added a comment - Would it make sense to leverage payloads for level pruning? Encode the int level number as a payload and use that at search/faceting time - any advantages to that?
          Hide
          Erik Hatcher added a comment -

          See http://wiki.apache.org/solr/HierarchicalFaceting for details on this approach and comparing to other approaches like SOLR-792

          Show
          Erik Hatcher added a comment - See http://wiki.apache.org/solr/HierarchicalFaceting for details on this approach and comparing to other approaches like SOLR-792
          Erik Hatcher made changes -
          Attachment SOLR-64.patch [ 12413925 ]
          Hide
          Erik Hatcher added a comment -

          Updated patch to trunk. Only real change was removing hiefacet field, and mapping the hierarchy type to *_h instead - to keep the schema from getting bloated with example fields.

          Show
          Erik Hatcher added a comment - Updated patch to trunk. Only real change was removing hiefacet field, and mapping the hierarchy type to *_h instead - to keep the schema from getting bloated with example fields.
          Hide
          Erik Hatcher added a comment -

          David - I'm not seeing any problems with trailing slashes - looks the same in the response as without. However, using leading slashes does cause a difference and I think that should be fixed.

          Definitely a nice patch. I'm wondering, though, if making additional faceting like this is perhaps best implemented as an additional search component (like SOLR-792).

          And, another nicety (perhaps even a necessity) would be the ability to put additional token filters in the mix to add custom information to each term indexed (I'm thinking payloads here).

          Show
          Erik Hatcher added a comment - David - I'm not seeing any problems with trailing slashes - looks the same in the response as without. However, using leading slashes does cause a difference and I think that should be fixed. Definitely a nice patch. I'm wondering, though, if making additional faceting like this is perhaps best implemented as an additional search component (like SOLR-792 ). And, another nicety (perhaps even a necessity) would be the ability to put additional token filters in the mix to add custom information to each term indexed (I'm thinking payloads here).
          Hide
          David Smiley added a comment -

          If the hierarchy passed to this field type has a trailing '/' like ion your samples here then it works but it doesn't if it is not supplied. Either the field type should throw an error or it should implicitly add a '/' if it isn't present. I'm not sure how it handles leading slashes but it should behave similarly.
          Great patch by the way.

          Show
          David Smiley added a comment - If the hierarchy passed to this field type has a trailing '/' like ion your samples here then it works but it doesn't if it is not supplied. Either the field type should throw an error or it should implicitly add a '/' if it isn't present. I'm not sure how it handles leading slashes but it should behave similarly. Great patch by the way.
          Koji Sekiguchi made changes -
          Attachment SOLR-64.patch [ 12406541 ]
          Hide
          Koji Sekiguchi added a comment - - edited

          First draft, need more test. This version doesn't support distributed environment.

          • schema setup
            schema.xml
            <fieldType name="hierarchy" class="solr.HierarchicalFacetField" omitNorms="true" positionIncrementGap="0" indexed="true" stored="false" />
            <field name="hiefacet" type="hierarchy" indexed="true" stored="true" multiValued="true" />
            
          • sample data
            sample data
            <add>
              <doc>
                <field name="id">1</field>
                <field name="hiefacet">A/B/E/</field>
                <field name="hiefacet">B/B/D/E/</field>
              </doc>
              <doc>
                <field name="id">2</field>
                <field name="hiefacet">A/B/E/</field>
              </doc>
              <doc>
                <field name="id">3</field>
                <field name="hiefacet">A/B/F/</field>
              </doc>
              <doc>
                <field name="id">4</field>
                <field name="hiefacet">A/C/G/</field>
              </doc>
              <doc>
                <field name="id">5</field>
                <field name="hiefacet">A/C/G/</field>
              </doc>
              <doc>
                <field name="id">6</field>
                <field name="hiefacet">A/C/G/</field>
              </doc>
              <doc>
                <field name="id">7</field>
                <field name="hiefacet">A/D/</field>
              </doc>
              <doc>
                <field name="id">8</field>
                <field name="hiefacet">A/</field>
              </doc>
              <doc>
                <field name="id">9</field>
                <field name="hiefacet">B/B/C/</field>
              </doc>
            </add>
            
          • usage:
            http://localhost:8983/solr/select/?q=*%3A*&version=2.2&start=0&rows=10&indent=on&facet=on&facet.field=hiefacet&wt=json
            &facet=on&facet.field=hiefacet
             "facet_counts":{
              "facet_queries":{},
              "facet_fields":{
            	"hiefacet":[
            	 "sub_facets",[
            	  "A",8,
            	  "path-A","A/",
            	  "sub_facets",[
            		"B",3,
            		"path-B","A/B/",
            		"sub_facets",[
            		 "E",2,
            		 "path-E","A/B/E/",
            		 "F",1,
            		 "path-F","A/B/F/"],
            		"C",3,
            		"path-C","A/C/",
            		"sub_facets",[
            		 "G",3,
            		 "path-G","A/C/G/"],
            		"D",1,
            		"path-D","A/D/"],
            	  "B",2,
            	  "path-B","B/",
            	  "sub_facets",[
            		"B",2,
            		"path-B","B/B/",
            		"sub_facets",[
            		 "C",1,
            		 "path-C","B/B/C/",
            		 "D",1,
            		 "path-D","B/B/D/",
            		 "sub_facets",[
            "E",1,
            "path-E","B/B/D/E/"]]]]]},
              "facet_dates":{}}
            
          Show
          Koji Sekiguchi added a comment - - edited First draft, need more test. This version doesn't support distributed environment. schema setup schema.xml <fieldType name= "hierarchy" class= "solr.HierarchicalFacetField" omitNorms= "true" positionIncrementGap= "0" indexed= "true" stored= "false" /> <field name= "hiefacet" type= "hierarchy" indexed= "true" stored= "true" multiValued= "true" /> sample data sample data <add> <doc> <field name= "id" > 1 </field> <field name= "hiefacet" > A/B/E/ </field> <field name= "hiefacet" > B/B/D/E/ </field> </doc> <doc> <field name= "id" > 2 </field> <field name= "hiefacet" > A/B/E/ </field> </doc> <doc> <field name= "id" > 3 </field> <field name= "hiefacet" > A/B/F/ </field> </doc> <doc> <field name= "id" > 4 </field> <field name= "hiefacet" > A/C/G/ </field> </doc> <doc> <field name= "id" > 5 </field> <field name= "hiefacet" > A/C/G/ </field> </doc> <doc> <field name= "id" > 6 </field> <field name= "hiefacet" > A/C/G/ </field> </doc> <doc> <field name= "id" > 7 </field> <field name= "hiefacet" > A/D/ </field> </doc> <doc> <field name= "id" > 8 </field> <field name= "hiefacet" > A/ </field> </doc> <doc> <field name= "id" > 9 </field> <field name= "hiefacet" > B/B/C/ </field> </doc> </add> usage: http://localhost:8983/solr/select/?q=*%3A*&version=2.2&start=0&rows=10&indent=on&facet=on&facet.field=hiefacet&wt=json &facet=on&facet.field=hiefacet "facet_counts" :{ "facet_queries" :{}, "facet_fields" :{ "hiefacet" :[ "sub_facets" ,[ "A" ,8, "path-A" , "A/" , "sub_facets" ,[ "B" ,3, "path-B" , "A/B/" , "sub_facets" ,[ "E" ,2, "path-E" , "A/B/E/" , "F" ,1, "path-F" , "A/B/F/" ], "C" ,3, "path-C" , "A/C/" , "sub_facets" ,[ "G" ,3, "path-G" , "A/C/G/" ], "D" ,1, "path-D" , "A/D/" ], "B" ,2, "path-B" , "B/" , "sub_facets" ,[ "B" ,2, "path-B" , "B/B/" , "sub_facets" ,[ "C" ,1, "path-C" , "B/B/C/" , "D" ,1, "path-D" , "B/B/D/" , "sub_facets" ,[ "E" ,1, "path-E" , "B/B/D/E/" ]]]]]}, "facet_dates" :{}} usage: facet.depth http://localhost:8983/solr/select/?q=*%3A*&version=2.2&start=0&rows=10&indent=on&facet=on&facet.field=hiefacet&facet.depth=2&wt=json &facet.field=hiefacet&facet.depth=2 "facet_counts" :{ "facet_queries" :{}, "facet_fields" :{ "hiefacet" :[ "sub_facets" ,[ "A" ,8, "path-A" , "A/" , "sub_facets" ,[ "B" ,3, "path-B" , "A/B/" , "C" ,3, "path-C" , "A/C/" , "D" ,1, "path-D" , "A/D/" ], "B" ,2, "path-B" , "B/" , "sub_facets" ,[ "B" ,2, "path-B" , "B/B/" ]]]}, "facet_dates" :{}} usage: facet.prefix http://localhost:8983/solr/select/?q=*%3A*&version=2.2&start=0&rows=10&indent=on&facet=on&facet.field=hiefacet&wt=json&facet.prefix=A%2FB%2F &facet=on&facet.field=hiefacet&facet.prefix=A/B/ "facet_counts" :{ "facet_queries" :{}, "facet_fields" :{ "hiefacet" :[ "sub_facets" ,[ "B" ,3, "path-B" , "A/B/" , "sub_facets" ,[ "E" ,2, "path-E" , "A/B/E/" , "F" ,1, "path-F" , "A/B/F/" ]]]}, "facet_dates" :{}}
          Shalin Shekhar Mangar made changes -
          Fix Version/s 1.4 [ 12313351 ]
          Fix Version/s 1.5 [ 12313566 ]
          Hide
          Shalin Shekhar Mangar added a comment -

          Marking for 1.5

          Show
          Shalin Shekhar Mangar added a comment - Marking for 1.5
          Shalin Shekhar Mangar made changes -
          Field Original Value New Value
          Fix Version/s 1.4 [ 12313351 ]
          Hide
          Yonik Seeley added a comment -

          Strict Facet Hierarchies:

          • a response format that can more efficiently encapsulate hierarchies
          • maybe format flexible enough to encompass other hierarchies (non-tree, defined via solrconfig.xml, etc)
          • strict hierarchy field faceting, with a single field value per document containing all the ordered constraints (a path)
          • ability to select depth to return to the client
          • perhaps an ability to select a variable depth based on the number of items selected at that node
          • expand node if count > 100.... or maybe expand node if count > 10% of hits

          http://www.nabble.com/Hierarchical-Facets--tf2560327.html#a7135353

          Show
          Yonik Seeley added a comment - Strict Facet Hierarchies: a response format that can more efficiently encapsulate hierarchies maybe format flexible enough to encompass other hierarchies (non-tree, defined via solrconfig.xml, etc) strict hierarchy field faceting, with a single field value per document containing all the ordered constraints (a path) ability to select depth to return to the client perhaps an ability to select a variable depth based on the number of items selected at that node expand node if count > 100.... or maybe expand node if count > 10% of hits http://www.nabble.com/Hierarchical-Facets--tf2560327.html#a7135353
          Yonik Seeley created issue -

            People

            • Assignee:
              Unassigned
              Reporter:
              Yonik Seeley
            • Votes:
              39 Vote for this issue
              Watchers:
              53 Start watching this issue

              Dates

              • Created:
                Updated:

                Development