zacharymorn commented on a change in pull request #25:
URL: https://github.com/apache/lucene/pull/25#discussion_r598035085
##########
File path: lucene/facet/src/java/org/apache/lucene/facet/FacetsConfig.java
##########
@@ -87,6 +89,8 @@
* True if drilling down by a whole dimension, to match all documents that
had any value for
* this dimension, is necessary (default is true)
*/
+ // nocommit should this (control for only label / dim name indexing) be
deprecated to favor the
Review comment:
Using enum to replace the 2 booleans is a great idea! I'll change it in
a bit.
However, I have been thinking about one question during when I worked on
this yesterday, and think I should ask after seeing your comment above: does
full path term count as "drill down term" ? If it does count, and full path
term should be skipped for indexing as well when drill down term indexing is
disabled, then wouldn't the full path information provided via
`FacetField(dimension, path1, path2, path3...)` is lost in the index? If it
does not count, and we should always index full path term, then wouldn't `Index
no drill down terms` == `Index only full path drill down`?
For clarity, I've listed the enum options with different drill down terms
examples below that I have in mind. Please let me know if this is the correct
understanding.
```
/**
* Drill down terms indexing option to control whether dimension and
sub-path terms should be
* indexed.
*/
public enum DrillDownTermsIndexing {
/**
* Index only full-path drill down terms. No dimension nor sub-path
indexing.
* e.g. for FaceField("a", "foo/bar/baz"), we would only index value "a
foo bar baz"
*/
FULL_PATH_ONLY,
/**
* Index sub-path and full-path down terms. No dimension indexing.
* e.g. for FaceField("a", "foo/bar/baz"), we would only index values "a
foo", "a foo bar", and "a foo baz"
*/
SUB_PATH_AND_FULL_PATH,
/**
* Index dimension and full-path drill down terms. No sub-path indexing.
* e.g. for FaceField("a", "foo/bar/baz"), we would only index values
"a" and "a foo baz"
* This is weird usage and currently not available.
*/
// DIMENSION_AND_FULL_PATH,
/**
* Index dimension, sub-path and full-path drill down terms.
* e.g. for FaceField("a", "foo/bar/baz"), we would index all values
"a", "a foo", "a foo bar", and "a foo baz"
* This is the default / existing behavior
*/
ALL
}
```
##########
File path: lucene/facet/src/java/org/apache/lucene/facet/FacetsConfig.java
##########
@@ -65,6 +65,8 @@
// int/float/bytes in a single indexed field:
private final Map<String, String> assocDimTypes = new ConcurrentHashMap<>();
+ private boolean disableDrillDown = false;
Review comment:
Thanks for the suggestion Robert! I had previously thought about it
(prefer positive statement over negative one), but ended up choosing
`disableDrillDown` variable / API naming as drill down terms indexing is an
existing behavior, so I'm not sure if adding `enableDrillDown` variable / API
may add confusion for existing Lucene clients that this indexing needs to be
explicitly enabled.
However, I'm planning to change the API from taking a boolean to taking an
enum instead as Mike suggested (`setDrillDownTermsIndexingOption`) , so I guess
we should be good there?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]