You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@solr.apache.org by Scott Derrick <sc...@tnstaafl.net> on 2021/09/22 17:31:38 UTC

Using collapse and expand results

I was using result grouping but the docs recommend using collapse expand

I tried this simple request and am seeing an error I don't understand?

responseHeader: {

     status: 500,
     QTime: 4,
     params: {
         q: "type:(incoming_correspondence)",
         fl: "title,author,origin,origGeo,settlement,region",
         json: "",
         sort: "score desc",
         fq: "{!collapse field=author}"
     }

},
error: {

     msg: "java.io.IOException: 64 bit numeric collapse fields are not supported",
     truncated result.....


if I use grouping on the same field, I get the expected result

responseHeader: {

     status: 0,
     QTime: 29,
     params: {
         q: "type:(incoming_correspondence)",
         fl: "title,author,origin,origGeo,settlement,region",
         json: "",
         sort: "score desc",
         group.field: "author",
         group: "true"
     }

},
grouped: {

     author: {
         matches: 2661,
         groups: [
             {
                 groupValue: "baker",
                 doclist: {
                     numFound: 14,
                     start: 0,
                     docs: [
                         {
                             author: "Mary Baker Eddy",
                             origin: "1885-10-07",
                             title: "Mary Baker Eddy to Sarah H. Crosse, October 7, 1885"
                         }
                     ]
                 }
             },
    truncated result....

Re: Using collapse and expand results

Posted by Rahul Goswami <ra...@gmail.com>.
Scott,
What is the data type of the field "author" in your schema? Collapse parser
works only for string, int and float data types types

-Rahul

On Wed, Sep 22, 2021 at 1:33 PM Scott Derrick <sc...@tnstaafl.net> wrote:

>
> I was using result grouping but the docs recommend using collapse expand
>
> I tried this simple request and am seeing an error I don't understand?
>
> responseHeader: {
>
>      status: 500,
>      QTime: 4,
>      params: {
>          q: "type:(incoming_correspondence)",
>          fl: "title,author,origin,origGeo,settlement,region",
>          json: "",
>          sort: "score desc",
>          fq: "{!collapse field=author}"
>      }
>
> },
> error: {
>
>      msg: "java.io.IOException: 64 bit numeric collapse fields are not
> supported",
>      truncated result.....
>
>
> if I use grouping on the same field, I get the expected result
>
> responseHeader: {
>
>      status: 0,
>      QTime: 29,
>      params: {
>          q: "type:(incoming_correspondence)",
>          fl: "title,author,origin,origGeo,settlement,region",
>          json: "",
>          sort: "score desc",
>          group.field: "author",
>          group: "true"
>      }
>
> },
> grouped: {
>
>      author: {
>          matches: 2661,
>          groups: [
>              {
>                  groupValue: "baker",
>                  doclist: {
>                      numFound: 14,
>                      start: 0,
>                      docs: [
>                          {
>                              author: "Mary Baker Eddy",
>                              origin: "1885-10-07",
>                              title: "Mary Baker Eddy to Sarah H. Crosse,
> October 7, 1885"
>                          }
>                      ]
>                  }
>              },
>     truncated result....
>

Re: Using collapse and expand results

Posted by Scott Derrick <sc...@tnstaafl.net>.
Rahul,

	Thanks, the field I was using was text_general.  Switching to a String fixed the issue.

Scott