Skip to content

Added values only to discovery count.#3530

Open
hoper-38709 wants to merge 12 commits into
integrationfrom
task/add-sum-count-to-discovery
Open

Added values only to discovery count.#3530
hoper-38709 wants to merge 12 commits into
integrationfrom
task/add-sum-count-to-discovery

Conversation

@hoper-38709
Copy link
Copy Markdown
Collaborator

Add values only option to return from a DiscoveryLogic/ DiscoveryIterator.

@hoper-38709 hoper-38709 force-pushed the task/add-sum-count-to-discovery branch from 0707bd6 to 076cbf5 Compare May 1, 2026 13:14
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.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

apply similar logic to DATE and DATATYPE. We only want to show the term value and the combined vis.

@hlgp
Copy link
Copy Markdown
Collaborator

hlgp commented May 8, 2026

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");
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants