Problem with SolrJ and Grouping

2011-09-12 Thread Kirill Lykov
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
“”:

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
 
 
0621name:hi searchField:hi1500GeonameIdtruexml202.24053324704082470408Haute Steppe, region, Al Qaşrayn, Tunisia 538779935.259.0High Steppes 64.0Africa; TN; Tunisia; 02; Al Qaşrayn; ; ; High Steppes; Haute Steppe, region, Al Qaşrayn, Tunisia 53877999.0058.99535.25535.24515724121572412Ngọc Nh, Vietnam 370427421.1833105.35Ngoc Hi 29.0Asia; VN; Vietnam; 16; ; ; ; Ngoc Hi; Ngọc Nh, Vietnam 3704274105.36105.3421.193321.173315738011573801Na Hi, Bắc Thái Tỉnh, Vietnam 370681222.5106.017Na Hi 29.0Asia; VN; Vietnam; 02; Bắc Thái Tỉnh; ; ; Na Hi; Na Hi, Bắc Thái Tỉnh, Vietnam 3706812106.027106.00722.5122.4915759551575955Ðộng Li Hi, hill, Cao Bang, Vietnam 371132116.25107.7Dong Li Hi 64.0Asia; VN; Vietnam; 04; Cao Bang; ; ; Dong Li Hi; Ðộng Li Hi, hill, Cao Bang, Vietnam 3711321107.705107.69516.25516.24515773011577301Núi Lang Hi, hill, Bắc Thái Tỉnh, Vietnam 371427721.6333105.883Nui Lang Hi 64.0Asia; VN; Vietnam; 02; Bắc Thái Tỉnh; ; ; Nui Lang Hi; Núi Lang Hi, hill, Bắc Thái Tỉnh, Vietnam 3714277105.888105.87821.638321.628315807951580795Hòa Hy, Hải Phòng, Vietnam 372150220.8106.9Hoa-Hi 29.0Asia; VN; Vietnam; 13; Hải Phòng; ; ; Hoa-Hi; Hòa Hy, Hải Phòng, Vietnam 3721502106.91106.8920.8120.7915809491580949Nam Hi, stream, Lai Châu, Vietnam 372184622.15103.167Nam Hi 80.0Asia; VN; Vietnam; 89; Lai Châu; ; ; Nam Hi; Nam Hi, stream, Lai Châu, Vietnam 3721846103.172103.16222.15522.14515809501580950Nam Hi, stream, Thua Thien-Hue, Vietnam 372184719.5104.483Houei Hi 80.0Asia; VN; Vietnam; 26; Thua Thien-Hue; ; ; Houei Hi; Nam Hi, stream, Thua Thien-Hue, Vietnam 3721847104.488104.47819.50519.49515811201581120Hao Chu Hi, peak, Nin Thuan, Vietnam 372221611.7833109.0Hao Chu Hi 64.0Asia; VN; Vietnam; 36; Nin Thuan; ; ; Hao Chu Hi; Hao Chu Hi, peak, Nin Thuan, Vietnam 3722216109.005108.99511.788311.778315820461582046Rocher Élevé, rock, Nin Thuan, Vietnam 372440910.6167108.9High Rock 64.0Asia; VN; Vietnam; 36; Nin Thuan; ; ; High Rock; Rocher Élevé, rock, Nin Thuan, Vietnam 3724409108.905108.89510.621710.611715855951585595Chay Hi Ho, Vietnam 373225621.85103.95Chay Hi Ho 29.0Asia; VN; Vietnam; 19; ; ; ; Chay Hi Ho; Chay Hi Ho, Vietnam 3732256103.96103.9421.8621.8434900693490069High Peak, peak, Portland, Jamaica 717024318.0333-76.3667High Peak 64.0North America; JM; Jamaica; 07; Portland; ; ; High Peak; High Peak, peak, Portland, Jamaica 7170243-76.3617-76.371718.038318.028334900703490070High Peak, mountain, Portland, Jamaica 717024418.0833-76.6167High Peak 64.0North America; JM; Jamaica; 07; Portland; ; ; High Peak; High Peak, mountain, Portland, Jamaica 7170244-76.6117-76.621718.088318.078334900713490071High Peak, mountain, Portland, Jamaica 717024518.0667-76.5667High Peak 64.0North America; JM; Jamaica; 07; Portland; ; ; High Peak; High Peak, mountain, Portland, Jamaica 7170245-76.5617-76.571718.071718.061734900733490073High Hill, hill, Saint Ann, Jamaica 717024718.3167-77.2167High Hill 64.0North America; JM; Jamaica; 09; Saint Ann; ; ; High Hill; High Hill, hill, Saint Ann, Jamaica 7170247-77.2117-77.221718.321718.311734900743490074High Hill, hill, Saint Thomas, Jamaica 717024818.0333-76.5833High Hill 64.0North America; JM; Jamaica; 14; Saint Thomas; ; ; High Hill; High Hill, hill, Saint Thomas, Jamaica 7170248-76.5783-76.588318.038318.028333668273366827High Riding, Western Cape, South Africa 6953941-34.118.3833High Riding 29.0Africa; ZA; South Africa; 11; Western Cape; ; ; High Riding; High Riding, Western Cape, South Africa 695394118.393318.3733-34.09-34.1134246903424690Alfefje

Re: Problem with SolrJ and Grouping

2011-09-12 Thread Kirill Lykov
Martijn,

I can't find the fixed version.
I've got the last version of SolrJ but I see only minor changes in
XMLResponseParser.java. And it doesn't support grouping yet. I also
checked branch_3x, branch for 3.4.

On Mon, Sep 12, 2011 at 5:45 PM, Martijn v Groningen
 wrote:
> Also the error you described when wt=xml and using SolrJ is also fixed
> in 3.4 (and in trunk / branch3x).
> You can wait for the 3.4 release of use a night 3x build.
>
> Martijn
>
> On 12 September 2011 12:41, Sanal K Stephen  wrote:
>> Kirill,
>>
>>         Parsing the grouped result using SolrJ is not released yet I
>> think..its going to release with Solr 3.4.0.SolrJ client cannot parse
>> grouped and range facets results SOLR-2523.
>>
>> see the release notes of Solr 3.4.0
>> http://wiki.apache.org/solr/ReleaseNote34
>>
>>
>> On Mon, Sep 12, 2011 at 3:51 PM, Kirill Lykov wrote:
>>
>>> 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
>>> “”:
>>>
>>>        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
>>>
>>
>>
>>
>> --
>> Regards,
>> Sanal Kannappilly Stephen
>>
>
>
>
> --
> Met vriendelijke groet,
>
> Martijn van Groningen
>



-- 
Best regards,
Kirill Lykov,
Software Engineer,
Data East LLC,
tel.:+79133816052,
LinkedIn profile: http://www.linkedin.com/pub/kirill-lykov/12/860/16