[ 
https://issues.apache.org/jira/browse/SOLR-2834?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13967819#comment-13967819
 ] 

Georg Sorst commented on SOLR-2834:
-----------------------------------

I would really like to fix this issue, but need some advice on what / where to 
fix exactly. I see two options:

# Fix the output of the field-analysis request so that it uses {{<arr ...}} for 
CharFilters just like it does for Tokenizers and TokenFilters
** This will probably confuse Solr Admin and who knows what else
# Fix the {{FieldAnalysisResponse}} / {{AnalysisResponseBase}} so that it can 
deal with the current response format ({{<str ..}} for CharFilters)
** The {{AnalysisResponseBase}} assumes in many places that the output is 
{{arr->lst->str}} due to the Generics of the NamedLists; it would be hard to 
make this change decently type-safe

I'm a bit lost here. If someone could give me a few pointers which option is 
better and which tests to adapt I'll glady try to take care of it.

> AnalysisResponseBase.java doesn't handle 
> org.apache.solr.analysis.HTMLStripCharFilter
> -------------------------------------------------------------------------------------
>
>                 Key: SOLR-2834
>                 URL: https://issues.apache.org/jira/browse/SOLR-2834
>             Project: Solr
>          Issue Type: Bug
>          Components: clients - java, Schema and Analysis
>    Affects Versions: 3.4, 3.6, 4.2
>            Reporter: Shane
>            Assignee: Shalin Shekhar Mangar
>            Priority: Blocker
>              Labels: patch
>         Attachments: AnalysisResponseBase.patch
>
>   Original Estimate: 5m
>  Remaining Estimate: 5m
>
> When using FieldAnalysisRequest.java to analysis a field, a 
> ClassCastExcpetion is thrown if the schema defines the filter 
> org.apache.solr.analysis.HTMLStripCharFilter.  The exception is:
> java.lang.ClassCastException: java.lang.String cannot be cast to 
> java.util.List
>        at 
> org.apache.solr.client.solrj.response.AnalysisResponseBase.buildPhases(AnalysisResponseBase.java:69)
>        at 
> org.apache.solr.client.solrj.response.FieldAnalysisResponse.setResponse(FieldAnalysisResponse.java:66)
>        at 
> org.apache.solr.client.solrj.request.FieldAnalysisRequest.process(FieldAnalysisRequest.java:107)
> My schema definition is:
>     <fieldType name="text" class="solr.TextField" positionIncrementGap="100">
>       <analyzer>
>         <charFilter class="solr.HTMLStripCharFilterFactory" />
>         <tokenizer class="solr.StandardTokenizerFactory" />
>         <filter class="solr.StandardFilterFactory" />
>         <filter class="solr.TrimFilterFactory" />
>         <filter class="solr.LowerCaseFilterFactory" />
>       </analyzer>
>     </fieldType>
> The response is part is:
>         <lst name="query">
>           <str name="org.apache.solr.analysis.HTMLStripCharFilter">testing 
> analysis</str>
>           <arr name="org.apache.lucene.analysis.standard.StandardTokenizer">
>             <lst>...
> A simplistic fix would be to test if the Entry value is an instance of List.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to