Skip to content

SOLR-16162: FilterQuery should implement DocSetProducer#814

Closed
magibney wants to merge 1 commit intoapache:mainfrom
magibney:SOLR-16162-filterquery-docset-producer
Closed

SOLR-16162: FilterQuery should implement DocSetProducer#814
magibney wants to merge 1 commit intoapache:mainfrom
magibney:SOLR-16162-filterquery-docset-producer

Conversation

@magibney
Copy link
Contributor

See: SOLR-16162

"producing a DocSet" is what FilterQuery is actually doing anyway; but more important practically: this avoids the cloning of the backing query's DocSet (and the creation of superfluous DocSets).

that's what it's doing anyway; but more important practically:
this avoids the cloning of the backing query's DocSet (and
the creation of superfluous DocSets).
@risdenk
Copy link
Contributor

risdenk commented May 6, 2022

As described in the jira and here, the description and fix seems reasonable to me. I just don't know the code well enough in this part to say if this should go in.

@Override
public DocSet createDocSet(SolrIndexSearcher searcher) throws IOException {
/*
There is a substantial practical reason for FilterQuery to implement DocSetProducer:
Copy link
Member

Choose a reason for hiding this comment

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

Well, you know, it might not be a good idea to open this can of worms.
There's org.apache.solr.search.SolrIndexSearcher#getDocSetNC, where NC implies NOcache, I suppose. That method hits org.apache.solr.search.DocSetUtil#createDocSet(), which checks for DocSetProducer. I'm not sure if reaching filtercache here is what getDocSetNC is plan to do.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, NC=no-cache; it's a little counterintuitive on the surface, but indeed that's the fundamental purpose of FilterQuery: it is used to consult the cache in contexts that otherwise would not cache, by reaching out to the filterCache "behind the scenes".

Often we would in fact expect to arrive at FilterQuery.createDocSet() via SolrIndexSearcher.getDocSetNC(), because FilterQuery.getCacche() now returns false. But what that really signifies is "don't cache the top level" ... "(because I handle reaching out the filterCache internally)". #624 fixed the fact that FilterQuery would previously have been cached twice.

This PR doesn't actually change whether FilterQuery hits the filterCache ... it always does, by definition. It just changes whether, having hit the cache, it forces the caller to build a clone of the cached DocSet (as it currently does), or supports a way to directly return the cached DocSet instance.

@magibney
Copy link
Contributor Author

Pending feedback/objections, I plan to merge this in the coming week.

@magibney
Copy link
Contributor Author

magibney commented Aug 3, 2023

ha, thanks for noticing this one. I guess I missed the "coming week" window by more than a year 😅 . I'll take care of this shortly.

@github-actions
Copy link

This PR had no visible activity in the past 60 days, labeling it as stale. Any new activity will remove the stale label. To attract more reviewers, please tag someone or notify the dev@solr.apache.org mailing list. Thank you for your contribution!

@github-actions github-actions bot added the stale PR not updated in 60 days label Feb 21, 2024
@github-actions
Copy link

github-actions bot commented Oct 5, 2024

This PR is now closed due to 60 days of inactivity after being marked as stale. Re-opening this PR is still possible, in which case it will be marked as active again.

@github-actions github-actions bot added the closed-stale Closed after being stale for 60 days label Oct 5, 2024
@github-actions github-actions bot closed this Oct 5, 2024
@dsmiley
Copy link
Contributor

dsmiley commented Oct 5, 2024

@magibney did you have doubts on this one?

@magibney
Copy link
Contributor Author

No doubts at all, looks like I have some following up to do!

@magibney magibney reopened this Oct 11, 2024
@github-actions github-actions bot added cat:search and removed closed-stale Closed after being stale for 60 days stale PR not updated in 60 days labels Oct 11, 2024
@github-actions
Copy link

This PR has had no activity for 60 days and is now labeled as stale. Any new activity will remove the stale label. To attract more reviewers, please tag people who might be familiar with the code area and/or notify the dev@solr.apache.org mailing list. To exempt this PR from being marked as stale, make it a draft PR or add the label "exempt-stale". If left unattended, this PR will be closed after another 60 days of inactivity. Thank you for your contribution!

@github-actions github-actions bot added the stale PR not updated in 60 days label Dec 11, 2024
@github-actions
Copy link

This PR is now closed due to 60 days of inactivity after being marked as stale. Re-opening this PR is still possible, in which case it will be marked as active again.

@github-actions github-actions bot added the closed-stale Closed after being stale for 60 days label Feb 10, 2025
@github-actions github-actions bot closed this Feb 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cat:search closed-stale Closed after being stale for 60 days stale PR not updated in 60 days

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants