hacioguz / solr-php-client

Automatically exported from code.google.com/p/solr-php-client
Other
0 stars 0 forks source link

i have a problem on solr higlighting #63

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
i m searching on solr with this query

q=*:*&hl=true&hl.snippets=0&hl.fl=pagecontent&hl.fragsize=0&hl.alternateField=pa
gecontent&hl.maxAlternateFieldLength=50&indent=off

higlighting field return response.php

"highlighting":{
"":{"pagecontent":["a73a73a73a73 
a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73 
a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a7
3a73 ... ...T 1 e.a73w.. .a73 a"]},
"":{"pagecontent":["a73a73a73a73 
a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73 
a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a7
3a73 ... ...T 1 e.a73w.. .a73 a"]},
"":{"pagecontent":["a73a73a73a73 
a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73 
a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a7
3a73 ... ...T 1 e.a73w.. .a73 a"]},
"":{"pagecontent":["a73a73a73a73 
a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73 
a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a7
3a73 ... ...T 1 e.a73w.. .a73 a"]},
"":{"pagecontent":["a73a73a73a73 
a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73 
a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a7
3a73 ... ...T 1 e.a73w.. .a73 a"]},
"":{"pagecontent":["a73a73a73a73 
a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73 
a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a7
3a73 ... ...T 1 e.a73w.. .a73 a"]},
"":{"pagecontent":["a73a73a73a73 
a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73 
a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a7
3a73 ... ...T 1 e.a73w.. .a73 a"]},
"":{"pagecontent":["a73a73a73a73 
a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73 
a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a7
3a73 ... ...T 1 e.a73w.. .a73 a"]},
"":{"pagecontent":["a73a73a73a73 
a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73 
a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a7
3a73 ... ...T 1 e.a73w.. .a73 a"]},
"":{"pagecontent":["a73a73a73a73 
a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73 
a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a7
3a73 ... ...T 1 e.a73w.. .a73 a"]}
} 

but php-solr-client get one items but ten items on highlighting field

this like 

stdClass Object
(
    [_empty_] => stdClass Object
        (
            [pagecontent] => Array
                (
                    [0] => a73a73a73a73 a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73 a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73a73 ... ...T 1 e.a73w.. .a73 a
                )

        )

)

i m research and 

Response.php
$data = json_decode($this->_response->getBody()); this json_decode func reason

Please help for this issue

Original issue reported on code.google.com by hasani...@gmail.com on 28 Feb 2011 at 2:50

GoogleCodeExporter commented 8 years ago
the highlighting search component of solr returns highlighting results indexed 
(keyed) by your documents id field (check your schema.xml configuration file to 
see what you have set as your id field). In the output above I see ten results 
indexed by the id "" (blank) which is why the json_decode is putting them all 
under the _empty_ field in its output. 

Make sure your documents each have a unique ID field value. Otherwise you won't 
be able to match the results up to the proper document, as you're seeing here. 

Please use the mailing list if you want more help 
http://groups.google.com/group/php-solr-client, reserve reporting an issue for 
actual bug reports or feature requests. Thanks!

Original comment by donovan....@gmail.com on 28 Feb 2011 at 3:37

GoogleCodeExporter commented 8 years ago
thanks for help and immediatly answer

Original comment by hasani...@gmail.com on 28 Feb 2011 at 3:58