Added values only to discovery count.#3530
Conversation
0707bd6 to
076cbf5
Compare
| fields.add(this.makeField("VALUE", markings, "", 0L, thing.getTerm())); | ||
| /** | ||
| * Added query model to alias FIELD | ||
| * Added query model to alias FIELD, if DiscoveredThing::field both not NULL and not empty. |
There was a problem hiding this comment.
apply similar logic to DATE and DATATYPE. We only want to show the term value and the combined vis.
|
New direction: Turns out we don't need to aggregate the vis. We only need to return the first instance of each unique rowid. So, if valuesOnly, break when you get the first valid TermEntry. Each next iteration will have just a single DiscoveredThing. Do the logic to only set the term and vis. In setTop, precedent is already set to modify the column family to advance to the next column family. In the values only case we will want to skip to the next row. Note: appending a null byte to the end of the current row won't work, so recommend the next start key in the skip logic be the row and last possible column family (something like \uffff) |
| if (valuesOnly){ | ||
| Key skipKey = new Key(row, "\uffff"); | ||
| if(!columnFamilies.isEmpty()){ | ||
| skipKey = new Key(row, thing.getField(), "\uffff"); |
There was a problem hiding this comment.
Would be worth double checking with users to confirm desired behavior if they use valuesOnly with fielded literals. In that case they may want the discovered thing to be populated with the field. I could see the asks being:
- unfielded regex -> give me all unique values in the index that match this regex
- fielded regex -> give me all unique values for this field that match this regex
- unfielded literal -> confirm that this value exists at all?
- fielded literal -> confirm this value exists for this/these fields? or for which of these fields do we have this value? The latter suggesting we should still return the field name in this case
Add values only option to return from a DiscoveryLogic/ DiscoveryIterator.