[
https://issues.apache.org/jira/browse/SOLR-10132?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15878097#comment-15878097
]
Gus Heck commented on SOLR-10132:
---------------------------------
Hmm, would it be possible to test like this:
{code}
if (termFilter != SimpleFacets.MATCH_ALL) {
final BytesRef term = si.lookupOrd(startTermIndex+i);
if (!termFilter.test(term)) {
continue;
}
}
{code}
I'm generally not fond of null except when representing an unknown primitive
value (boxed of course), which is why I tried to eliminate it. It's not very
self documenting, and retaining it the list + switch you have added or a
string of if/else checking as in the original code, plus and a lot of other
reasons. http://www.yegor256.com/2014/05/13/why-null-is-bad.html is more
eloquent than I on this...
Perhaps it should be named {{MATCH_ALL_TERMS}} however, to avoid sounding like
it has something to do with {{MatchAllDocsQuery()}}
> Support facet.matches to cull facets returned with a regex
> ----------------------------------------------------------
>
> Key: SOLR-10132
> URL: https://issues.apache.org/jira/browse/SOLR-10132
> Project: Solr
> Issue Type: New Feature
> Security Level: Public(Default Security Level. Issues are Public)
> Components: faceting
> Affects Versions: 6.4.1
> Reporter: Gus Heck
> Assignee: Christine Poerschke
> Attachments: SOLR-10132.patch, SOLR-10132.patch, SOLR-10132.patch
>
>
> I recently ran into a case where I really wanted to only return the next
> level of a hierarchical facet, and while I was able to do that with a
> coordinated set of dynamic fields, it occurred to me that this would have
> been much much easier if I could have simply used PathHierarchyTokenizer and
> written
> &facet.matches="/my/current/prefix/[^/]+$"
> thereby limiting the returned facets to the next level down and not return
> the additional N levels I didn't (yet) want to display (numbering in the
> thousands near the top of the tree). I suspect there are other good use
> cases, and the patch seemed relatively tractable.
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]