I found that SolrQuery doesn’t work with grouping.
I constructed SolrQuery this way:

solrQuery = constructFullSearchQuery(searchParams);
solrQuery.set("group", true);
solrQuery.set("group.field", "GeonameId");

Solr successfully handles request and writes about that in log:

INFO: [] webapp=/solr path=/select
params={start=1&q=*:*&timeAllowed=1500&group.field=GeonameId&group=true&wt=xml&rows=20&version=2.2}
hits=12099579 status=0 QTime=2968

The error occurs when SolrJ tries to parse
XMLResponseParser.processResponse (line 324), where builder stores
“</lst>”:

        Object val = type.read( builder.toString().trim() );
        if( val == null && type != KnownType.NULL) {
          throw new XMLStreamException( "error reading value:"+type,
parser.getLocation() );
        }
        vals.add( val );
        break;

The problem is - val is null. It happens because handler for the type
LST returns null(line 178 in the same file):

LST    (false) { @Override public Object read( String txt ) { return null; } },

I don’t understand why it works this way. Xml which was returned by
Solr is valid.
If any I attached response xml to the letter. The error occures in the
line 3, column 14 661.
I use apache solr 3.3.0 and the same SolrJ.
-- 
Best regards,
Kirill Lykov,
Software Engineer,
Data East LLC,
tel.:+79133816052,
LinkedIn profile: http://www.linkedin.com/pub/kirill-lykov/12/860/16
<?xml version="1.0" encoding="UTF-8"?> 
<response> 
<lst name="responseHeader"><int name="status">0</int><int name="QTime">62</int><lst name="params"><str name="start">1</str><str name="q">name:hi searchField:hi</str><str name="timeAllowed">1500</str><str name="group.field">GeonameId</str><str name="group">true</str><str name="wt">xml</str><str name="rows">20</str><str name="version">2.2</str></lst></lst><lst name="grouped"><lst name="GeonameId"><int name="matches">40533</int><arr name="groups"><lst><str name="groupValue">2470408</str><result name="doclist" numFound="1" start="0"><doc><str name="GeonameId">2470408</str><str name="address">Haute Steppe, region, Al Qaşrayn, Tunisia </str><str name="id">5387799</str><double name="lat">35.25</double><double name="lon">9.0</double><str name="name">High Steppes </str><str name="rank">64.0</str><str name="searchField">Africa; TN; Tunisia; 02; Al Qaşrayn; ; ; High Steppes; Haute Steppe, region, Al Qaşrayn, Tunisia </str><str name="sourceFeatureClass"/><str name="sourceID">5387799</str><double name="xmax">9.005</double><double name="xmin">8.995</double><double name="ymax">35.255</double><double name="ymin">35.245</double></doc></result></lst><lst><str name="groupValue">1572412</str><result name="doclist" numFound="1" start="0"><doc><str name="GeonameId">1572412</str><str name="address">Ngọc Nh, Vietnam </str><str name="id">3704274</str><double name="lat">21.1833</double><double name="lon">105.35</double><str name="name">Ngoc Hi </str><str name="rank">29.0</str><str name="searchField">Asia; VN; Vietnam; 16; ; ; ; Ngoc Hi; Ngọc Nh, Vietnam </str><str name="sourceFeatureClass"/><str name="sourceID">3704274</str><double name="xmax">105.36</double><double name="xmin">105.34</double><double name="ymax">21.1933</double><double name="ymin">21.1733</double></doc></result></lst><lst><str name="groupValue">1573801</str><result name="doclist" numFound="1" start="0"><doc><str name="GeonameId">1573801</str><str name="address">Na Hi, Bắc Thái Tỉnh, Vietnam </str><str name="id">3706812</str><double name="lat">22.5</double><double name="lon">106.017</double><str name="name">Na Hi </str><str name="rank">29.0</str><str name="searchField">Asia; VN; Vietnam; 02; Bắc Thái Tỉnh; ; ; Na Hi; Na Hi, Bắc Thái Tỉnh, Vietnam </str><str name="sourceFeatureClass"/><str name="sourceID">3706812</str><double name="xmax">106.027</double><double name="xmin">106.007</double><double name="ymax">22.51</double><double name="ymin">22.49</double></doc></result></lst><lst><str name="groupValue">1575955</str><result name="doclist" numFound="2" start="0"><doc><str name="GeonameId">1575955</str><str name="address">Ðộng Li Hi, hill, Cao Bang, Vietnam </str><str name="id">3711321</str><double name="lat">16.25</double><double name="lon">107.7</double><str name="name">Dong Li Hi </str><str name="rank">64.0</str><str name="searchField">Asia; VN; Vietnam; 04; Cao Bang; ; ; Dong Li Hi; Ðộng Li Hi, hill, Cao Bang, Vietnam </str><str name="sourceFeatureClass"/><str name="sourceID">3711321</str><double name="xmax">107.705</double><double name="xmin">107.695</double><double name="ymax">16.255</double><double name="ymin">16.245</double></doc></result></lst><lst><str name="groupValue">1577301</str><result name="doclist" numFound="2" start="0"><doc><str name="GeonameId">1577301</str><str name="address">Núi Lang Hi, hill, Bắc Thái Tỉnh, Vietnam </str><str name="id">3714277</str><double name="lat">21.6333</double><double name="lon">105.883</double><str name="name">Nui Lang Hi </str><str name="rank">64.0</str><str name="searchField">Asia; VN; Vietnam; 02; Bắc Thái Tỉnh; ; ; Nui Lang Hi; Núi Lang Hi, hill, Bắc Thái Tỉnh, Vietnam </str><str name="sourceFeatureClass"/><str name="sourceID">3714277</str><double name="xmax">105.888</double><double name="xmin">105.878</double><double name="ymax">21.6383</double><double name="ymin">21.6283</double></doc></result></lst><lst><str name="groupValue">1580795</str><result name="doclist" numFound="2" start="0"><doc><str name="GeonameId">1580795</str><str name="address">Hòa Hy, Hải Phòng, Vietnam </str><str name="id">3721502</str><double name="lat">20.8</double><double name="lon">106.9</double><str name="name">Hoa-Hi </str><str name="rank">29.0</str><str name="searchField">Asia; VN; Vietnam; 13; Hải Phòng; ; ; Hoa-Hi; Hòa Hy, Hải Phòng, Vietnam </str><str name="sourceFeatureClass"/><str name="sourceID">3721502</str><double name="xmax">106.91</double><double name="xmin">106.89</double><double name="ymax">20.81</double><double name="ymin">20.79</double></doc></result></lst><lst><str name="groupValue">1580949</str><result name="doclist" numFound="1" start="0"><doc><str name="GeonameId">1580949</str><str name="address">Nam Hi, stream, Lai Châu, Vietnam </str><str name="id">3721846</str><double name="lat">22.15</double><double name="lon">103.167</double><str name="name">Nam Hi </str><str name="rank">80.0</str><str name="searchField">Asia; VN; Vietnam; 89; Lai Châu; ; ; Nam Hi; Nam Hi, stream, Lai Châu, Vietnam </str><str name="sourceFeatureClass"/><str name="sourceID">3721846</str><double name="xmax">103.172</double><double name="xmin">103.162</double><double name="ymax">22.155</double><double name="ymin">22.145</double></doc></result></lst><lst><str name="groupValue">1580950</str><result name="doclist" numFound="2" start="0"><doc><str name="GeonameId">1580950</str><str name="address">Nam Hi, stream, Thua Thien-Hue, Vietnam </str><str name="id">3721847</str><double name="lat">19.5</double><double name="lon">104.483</double><str name="name">Houei Hi </str><str name="rank">80.0</str><str name="searchField">Asia; VN; Vietnam; 26; Thua Thien-Hue; ; ; Houei Hi; Nam Hi, stream, Thua Thien-Hue, Vietnam </str><str name="sourceFeatureClass"/><str name="sourceID">3721847</str><double name="xmax">104.488</double><double name="xmin">104.478</double><double name="ymax">19.505</double><double name="ymin">19.495</double></doc></result></lst><lst><str name="groupValue">1581120</str><result name="doclist" numFound="1" start="0"><doc><str name="GeonameId">1581120</str><str name="address">Hao Chu Hi, peak, Nin Thuan, Vietnam </str><str name="id">3722216</str><double name="lat">11.7833</double><double name="lon">109.0</double><str name="name">Hao Chu Hi </str><str name="rank">64.0</str><str name="searchField">Asia; VN; Vietnam; 36; Nin Thuan; ; ; Hao Chu Hi; Hao Chu Hi, peak, Nin Thuan, Vietnam </str><str name="sourceFeatureClass"/><str name="sourceID">3722216</str><double name="xmax">109.005</double><double name="xmin">108.995</double><double name="ymax">11.7883</double><double name="ymin">11.7783</double></doc></result></lst><lst><str name="groupValue">1582046</str><result name="doclist" numFound="1" start="0"><doc><str name="GeonameId">1582046</str><str name="address">Rocher Élevé, rock, Nin Thuan, Vietnam </str><str name="id">3724409</str><double name="lat">10.6167</double><double name="lon">108.9</double><str name="name">High Rock </str><str name="rank">64.0</str><str name="searchField">Asia; VN; Vietnam; 36; Nin Thuan; ; ; High Rock; Rocher Élevé, rock, Nin Thuan, Vietnam </str><str name="sourceFeatureClass"/><str name="sourceID">3724409</str><double name="xmax">108.905</double><double name="xmin">108.895</double><double name="ymax">10.6217</double><double name="ymin">10.6117</double></doc></result></lst><lst><str name="groupValue">1585595</str><result name="doclist" numFound="1" start="0"><doc><str name="GeonameId">1585595</str><str name="address">Chay Hi Ho, Vietnam </str><str name="id">3732256</str><double name="lat">21.85</double><double name="lon">103.95</double><str name="name">Chay Hi Ho </str><str name="rank">29.0</str><str name="searchField">Asia; VN; Vietnam; 19; ; ; ; Chay Hi Ho; Chay Hi Ho, Vietnam </str><str name="sourceFeatureClass"/><str name="sourceID">3732256</str><double name="xmax">103.96</double><double name="xmin">103.94</double><double name="ymax">21.86</double><double name="ymin">21.84</double></doc></result></lst><lst><str name="groupValue">3490069</str><result name="doclist" numFound="1" start="0"><doc><str name="GeonameId">3490069</str><str name="address">High Peak, peak, Portland, Jamaica </str><str name="id">7170243</str><double name="lat">18.0333</double><double name="lon">-76.3667</double><str name="name">High Peak </str><str name="rank">64.0</str><str name="searchField">North America; JM; Jamaica; 07; Portland; ; ; High Peak; High Peak, peak, Portland, Jamaica </str><str name="sourceFeatureClass"/><str name="sourceID">7170243</str><double name="xmax">-76.3617</double><double name="xmin">-76.3717</double><double name="ymax">18.0383</double><double name="ymin">18.0283</double></doc></result></lst><lst><str name="groupValue">3490070</str><result name="doclist" numFound="1" start="0"><doc><str name="GeonameId">3490070</str><str name="address">High Peak, mountain, Portland, Jamaica </str><str name="id">7170244</str><double name="lat">18.0833</double><double name="lon">-76.6167</double><str name="name">High Peak </str><str name="rank">64.0</str><str name="searchField">North America; JM; Jamaica; 07; Portland; ; ; High Peak; High Peak, mountain, Portland, Jamaica </str><str name="sourceFeatureClass"/><str name="sourceID">7170244</str><double name="xmax">-76.6117</double><double name="xmin">-76.6217</double><double name="ymax">18.0883</double><double name="ymin">18.0783</double></doc></result></lst><lst><str name="groupValue">3490071</str><result name="doclist" numFound="1" start="0"><doc><str name="GeonameId">3490071</str><str name="address">High Peak, mountain, Portland, Jamaica </str><str name="id">7170245</str><double name="lat">18.0667</double><double name="lon">-76.5667</double><str name="name">High Peak </str><str name="rank">64.0</str><str name="searchField">North America; JM; Jamaica; 07; Portland; ; ; High Peak; High Peak, mountain, Portland, Jamaica </str><str name="sourceFeatureClass"/><str name="sourceID">7170245</str><double name="xmax">-76.5617</double><double name="xmin">-76.5717</double><double name="ymax">18.0717</double><double name="ymin">18.0617</double></doc></result></lst><lst><str name="groupValue">3490073</str><result name="doclist" numFound="1" start="0"><doc><str name="GeonameId">3490073</str><str name="address">High Hill, hill, Saint Ann, Jamaica </str><str name="id">7170247</str><double name="lat">18.3167</double><double name="lon">-77.2167</double><str name="name">High Hill </str><str name="rank">64.0</str><str name="searchField">North America; JM; Jamaica; 09; Saint Ann; ; ; High Hill; High Hill, hill, Saint Ann, Jamaica </str><str name="sourceFeatureClass"/><str name="sourceID">7170247</str><double name="xmax">-77.2117</double><double name="xmin">-77.2217</double><double name="ymax">18.3217</double><double name="ymin">18.3117</double></doc></result></lst><lst><str name="groupValue">3490074</str><result name="doclist" numFound="1" start="0"><doc><str name="GeonameId">3490074</str><str name="address">High Hill, hill, Saint Thomas, Jamaica </str><str name="id">7170248</str><double name="lat">18.0333</double><double name="lon">-76.5833</double><str name="name">High Hill </str><str name="rank">64.0</str><str name="searchField">North America; JM; Jamaica; 14; Saint Thomas; ; ; High Hill; High Hill, hill, Saint Thomas, Jamaica </str><str name="sourceFeatureClass"/><str name="sourceID">7170248</str><double name="xmax">-76.5783</double><double name="xmin">-76.5883</double><double name="ymax">18.0383</double><double name="ymin">18.0283</double></doc></result></lst><lst><str name="groupValue">3366827</str><result name="doclist" numFound="1" start="0"><doc><str name="GeonameId">3366827</str><str name="address">High Riding, Western Cape, South Africa </str><str name="id">6953941</str><double name="lat">-34.1</double><double name="lon">18.3833</double><str name="name">High Riding </str><str name="rank">29.0</str><str name="searchField">Africa; ZA; South Africa; 11; Western Cape; ; ; High Riding; High Riding, Western Cape, South Africa </str><str name="sourceFeatureClass"/><str name="sourceID">6953941</str><double name="xmax">18.3933</double><double name="xmin">18.3733</double><double name="ymax">-34.09</double><double name="ymin">-34.11</double></doc></result></lst><lst><str name="groupValue">3424690</str><result name="doclist" numFound="1" start="0"><doc><str name="GeonameId">3424690</str><str name="address">Alfefjeldene, mountains, Vestgrønland, Greenland </str><str name="id">7050225</str><double name="lat">66.3667</double><double name="lon">-53.3833</double><str name="name">High Alpland </str><str name="rank">64.0</str><str name="searchField">North America; GL; Greenland; 03; Vestgrønland; ; ; High Alpland; Alfefjeldene, mountains, Vestgrønland, Greenland </str><str name="sourceFeatureClass"/><str name="sourceID">7050225</str><double name="xmax">-53.3783</double><double name="xmin">-53.3883</double><double name="ymax">66.3717</double><double name="ymin">66.3617</double></doc></result></lst><lst><str name="groupValue">3426446</str><result name="doclist" numFound="1" start="0"><doc><str name="GeonameId">3426446</str><str name="address">High Rock, rock, South Georgia and The South Sandwich Islands, South Georgia and the South Sandwich Islands </str><str name="id">7053477</str><double name="lat">-53.9619</double><double name="lon">-37.4889</double><str name="name">High Rock </str><str name="rank">64.0</str><str name="searchField">Antarctica; GS; South Georgia and the South Sandwich Islands; 00; South Georgia and The South Sandwich Islands; ; ; High Rock; High Rock, rock, South Georgia and The South Sandwich Islands, South Georgia and the South Sandwich Islands </str><str name="sourceFeatureClass"/><str name="sourceID">7053477</str><double name="xmax">-37.4839</double><double name="xmin">-37.4939</double><double name="ymax">-53.9569</double><double name="ymin">-53.9669</double></doc></result></lst><lst><str name="groupValue">3426969</str><result name="doclist" numFound="2" start="0"><doc><str name="GeonameId">3426969</str><str name="address">High Rock, rock, Falkland Islands (Islas Malvinas), Falkland Islands </str><str name="id">7054446</str><double name="lat">-51.6667</double><double name="lon">-57.7667</double><str name="name">High Rock </str><str name="rank">64.0</str><str name="searchField">South America; FK; Falkland Islands; 00; Falkland Islands (Islas Malvinas); ; ; High Rock; High Rock, rock, Falkland Islands (Islas Malvinas), Falkland Islands </str><str name="sourceFeatureClass"/><str name="sourceID">7054446</str><double name="xmax">-57.7617</double><double name="xmin">-57.7717</double><double name="ymax">-51.6617</double><double name="ymin">-51.6717</double></doc></result></lst></arr></lst></lst> 
</response>

Reply via email to