Hi there,

I have the following dynamicFields definition in my schema.xml:


<!-- I18n DynamicFields -->

<dynamicField name="i18n*" type="string" indexed="true" stored="true" /> <!--
DynamicFields used typically for faceting issues by copying values from
other existing fields--> <dynamicField name="*_facet" type="string" indexed=
"true" stored="true" multiValued="true" />


I' ve seen that when fetching documents with /select?q=id:whateverId, the
results returned include both i18n* and *_facet fields filled. However,
when using real-time request handler (/get?ids:whateverIds) the result
fetched include only i18n* dynamic fields, but *_facet ones are not
included.

I have the impression during /get RequestHandler the server-side regular
expression used when parsing fields and fields values to return documents
with existing dynamic fields seems to be wrong. From the client side, I' ve
checked that the class DocField.java that parses SolrDocument to Bean ones
uses the following matcher:

 } else if (annotation.value().indexOf('*') >= 0) { // dynamic fields are
annotated as @Field("categories_*")

// if the field was annotated as a dynamic field, convert the name into a
pattern

// the wildcard (*) is supposed to be either a prefix or a suffix, hence
the use of replaceFirst

name = annotation.value().replaceFirst("\\*", "\\.*");

dynamicFieldNamePatternMatcher = Pattern.compile("^" + name + "$");

 } else {

name = annotation.value();

 }

So maybe a similar behavior from the server-side is wrong. That' s the only
reason I find to understand why when using /select all fields are returned
but when using /get those that matches *_facet regexp are not.

If you can confirm that this is a bug (because maybe is the expected
behavior, but after some years using Solr I think it is not) I can create
the JIRA issue and debug it more deeply to apply a patch with the aim to
help.


Regards,


-- 
- Luis Cappa

Reply via email to