[
https://issues.apache.org/jira/browse/SOLR-14282?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17257098#comment-17257098
]
David Smiley commented on SOLR-14282:
-------------------------------------
I'm doing a bunch of work in RTG right now in order to fix a complicated bug,
and I did a little JIRA searching and uncovered this issue. Indeed, /get
doesn't return copy-field targets by design, because it primarily exists for
internal purposes that require an "input" document (thus no application of copy
fields). But the primary/original part of it is public (not the extras like
getInputDocument), and I think it's confusing for it to behave differently from
what a searcher would return. I'd like to see the copy-field target filtering
be an explicit option that you have to ask for. Solr internal uses would do
this, or it may be implied for "getInputDocument" and other internal
functionality switches.
bq. Also - stored field values can come from not just the input document or a
copyField, but also update processors. IMO, for /get to return stored fields
like /select would return is asking too much...
Yes this can happen but (A) that doesn't happen by default so the distinction
is academic to many users, and (B) even then, the UpdateLog stores the final
SolrInputDocument and thus it _will_ return whatever those URPs produce (thus
looks like what /select returns).
> /get handler doesn't return copied fields
> -----------------------------------------
>
> Key: SOLR-14282
> URL: https://issues.apache.org/jira/browse/SOLR-14282
> Project: Solr
> Issue Type: Bug
> Components: search, SolrJ
> Affects Versions: 8.4
> Environment: SOLR 8.4.0, SOLRJ, Oracle Java 8
> Reporter: Andrei Minin
> Priority: Major
> Attachments: SOLR-14282-test-update.patch, copied_fields_test.zip,
> managed-schema.xml
>
>
> We are using /get handler to retrieve documents by id in our Java application
> (SolrJ)
> I found that copied fields are missing in documents returned by /get handler
> but same documents returned by query contain copied (by schema) fields.
> Attached documents:
> # Integration test project archive
> # Managed schema file for SOLR
> SOLR schema details:
> # Unique field name "d_ida_s"
> # Lowecase text type definition:
> {code:java}
> <fieldType name="lowercase" class="solr.TextField"
> positionIncrementGap="100">
> <analyzer>
> <tokenizer class="solr.KeywordTokenizerFactory"/>
> <filter class="solr.LowerCaseFilterFactory" />
> </analyzer>
> </fieldType>{code}
> 3. Copy field instruction sample:
> {code:java}
> <field name="ConcurrenceUserNameu_lca_s" type="lowercase" indexed="true"
> stored="true" multiValued="false"/>
> <copyField source="ConcurrenceUserNamea_s" dest="ConcurrenceUserNameu_lca_s"
> />
> {code}
> ConcurrenceUserNamea_s is string type field and ConcurrenceUserNameu_lca_s is
> lower case text type field.
> Integration test uploads document to SOLR server and makes 2 requests: one
> using /get rest point to fetch document by id and one using query <unique id
> field name>:<document id value>.
> Document returned by /get rest, doesn't have copied fields while document
> returned by query, contains copied fields.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]