-
Notifications
You must be signed in to change notification settings - Fork 711
Equal terms DocTransformer #3317
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
solr/core/src/java/org/apache/solr/response/transform/EqualTermsDocTransformer.java
Outdated
Show resolved
Hide resolved
/** | ||
* Gets the string field value, or null if not present or if found a list of values other than 1. | ||
*/ | ||
private String getFieldValue(SolrDocument doc) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't love the instance checks here... I wish there was a better typed API contract on the expected types.
solr/core/src/java/org/apache/solr/response/transform/EqualTermsDocTransformer.java
Outdated
Show resolved
Hide resolved
@@ -365,26 +366,45 @@ private SolrInputDocument addRandomDocument(final int docId) | |||
|
|||
final SolrInputDocument doc = | |||
sdoc( | |||
"id", "" + docId, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the newline placements are unfortunate; I can try to restore
JIRA TODO: https://issues.apache.org/jira/browse/SOLR-XXXXX
This is a sketch of a DocTransformer that emits a boolean field on the returned doc based on a document field being equal to an input stream, as compared by the analyzed text.
fl=id,isEqual:[equalterms field=subject value='John Smith']
I need this for work but looking for feedback on inclusion in Solr and naming and other things.