Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-4020

SolrJ 4.0.0 not serializing multilple filter queries correctly

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Duplicate
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: clients - java
    • Labels:

      Description

      Using multiple filter queries in a solrQuery causes an exception with the following details.

      org.apache.solr.common.SolrException: org.apache.lucene.queryparser.classic.ParseException: Cannot parse '[Ljava.lang.String;@1ec278b5': Encountered "<EOF>" at line 1, column 28.
      Was expecting one of:
      "TO" ...
      <RANGE_QUOTED> ...
      <RANGE_GOOP> ...

      The issues come up when using addFilterQuery() in the following manner:

      solrQuery.addFilterQuery("

      {!field f=facet_state}CA");
      solrQuery.addFilterQuery("{!field f=facet_city}Test City");

      or using it in the following way

      solrQuery.setFilterQueries("{!field f=facet_state}

      CA", "

      {!field f=facet_city}Test City");
      solrQuery.addFilterQuery("{!field f=facet_state}CA", "{!field f=facet_city}

      Test City");

      even if solrQuery.add() is used the issue still comes up

      solrQuery.add("fq", "your first filter");
      solrQuery.add("fq", "your second filter");

      In any case having multiple filter queries causes the issue.

      It seems that SolrJ is serializing a String[] instead of the separate String values. ModifiableSolrParams.java add() might be a good place to start the investigations.

      Thanks.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                hossman Chris M. Hostetter
                Reporter:
                indikat Indika Tantrigoda
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: