You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Shane Perry <th...@gmail.com> on 2011/10/14 16:28:19 UTC

ClassCastException when using FieldAnalysisRequest

Hi,

Using Solr 3.4.0, I am trying to do a field analysis via the
FieldAnalysisRequest feature in solrj.  During the process() call, the
following ClassCastException is thrown:

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 code is as follows:

FieldAnalysisRequest request = new FieldAnalysisRequest(myUri).
  addFieldName(field).
  setFieldValue(text).
  setQuery(text);

request.process(myServer);

Is there something I am doing wrong?  Any help would be appreciated.

Sincerely,

Shane

Re: ClassCastException when using FieldAnalysisRequest

Posted by Shane Perry <th...@gmail.com>.
After looking at this more, it appears that
solr.HTMLStripCharFilterFactory does not return a list which
AnalysisResponseBase is expecting.  I have created a bug ticket
(https://issues.apache.org/jira/browse/SOLR-2834)

On Fri, Oct 14, 2011 at 8:28 AM, Shane Perry <th...@gmail.com> wrote:
> Hi,
>
> Using Solr 3.4.0, I am trying to do a field analysis via the
> FieldAnalysisRequest feature in solrj.  During the process() call, the
> following ClassCastException is thrown:
>
> 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 code is as follows:
>
> FieldAnalysisRequest request = new FieldAnalysisRequest(myUri).
>  addFieldName(field).
>  setFieldValue(text).
>  setQuery(text);
>
> request.process(myServer);
>
> Is there something I am doing wrong?  Any help would be appreciated.
>
> Sincerely,
>
> Shane
>