xml response from clustering component in solr

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

xml response from clustering component in solr

miloskovacevic
Hello,
I have a solr 3.6 and carrot2 clustering enabled. In XML response from clustering component I have only urls of documents in each cluster but I need their titles too. How to enable that?
Regards, Milos
Reply | Threaded
Open this post in threaded view
|

Re: xml response from clustering component in solr

Dawid Weiss-2
Hi Milos,

> I have a solr 3.6 and carrot2 clustering enabled. In XML response from

You need to be more specific about how you configured the two. Is
Carrot2 configured inside Solr (as part of Solr's pipeline), is
Carrot2 used in stand-alone mode and connecting to Solr?

> clustering component I have only urls of documents in each cluster but I
> need their titles too. How to enable that?

Can't help much without the above information. If Carrot2 is connected
to Solr's pipeline you should specify which fields are used for the
document "title" and which one is used for the "snippet". This is
explained here:

http://wiki.apache.org/solr/ClusteringComponent

see section Configuration, namely here:

    <!-- Fields to cluster on -->
    <str name="carrot.title">name</str>
    <str name="carrot.snippet">features</str>

These fields need to be STORED on Solr so that their content can be
fetched for clustering.

Dawid

------------------------------------------------------------------------------
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. SALE $99.99 this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122412
_______________________________________________
Carrot2-developers mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/carrot2-developers
Reply | Threaded
Open this post in threaded view
|

Re: xml response from clustering component in solr

miloskovacevic
Hello,

> Hi Milos,
>
>> I have a solr 3.6 and carrot2 clustering enabled. In XML response from
>
> You need to be more specific about how you configured the two. Is
> Carrot2 configured inside Solr (as part of Solr's pipeline), is
> Carrot2 used in stand-alone mode and connecting to Solr?
>
Carrot2 is configured inside Solr (as part of Solr's pipeline).

> see section Configuration, namely here:
>
>    
>     <str name="carrot.title">name</str>
>     <str name="carrot.snippet">features</str>
>
> These fields need to be STORED on Solr so that their content can be
> fetched for clustering.

Yes, I configured carrot.title to point to name field of my doc and
snippet to point to doc's summary (both fields are stored) but the output
of the StandardRequestHandler (post to /select) is (I give only the
clusters part):

...
<arr name="clusters"><lst><arr
name="labels"><str>Message</str></arr><double
name="score">4.411255429809071</double><arr
name="docs"><str>VU9XUVNURUEPGgMERQkMAggGQSUFBxADAhsaEkULEBoLGgEKJwUMAkg6GxUGCwoFSQUdFUVWVFxRRFpZ</str><str>VU9XUVNURUEPGgMERQkMAggGQSUFBxADAhsaEkULEBoLGgEKJwUMAkg6GxUGCwoFSQUdFUVWVFxTTV5V</str><str>VU9XUVNURUEPGgMERQkMAggGQSUFBxADAhsaEkULEBoLGgEKJwUMAkg6GxUGCwoFSQUdFUVWVF9fTF9X</str><str>VU9XUVNURUEPGgMERQkMAggGQSUFBxADAhsaEkULEBoLGgEKJwUMAkg6GxUGCwoFSQUdFUVWVF9fTVtT</str><str>VU9XUVNURUEPGgMERQkMAggGQSUFBxADAhsaEkULEBoLGgEKJwUMAkg6GxUGCwoFSQUdFUVWVVdQR1xR</str><str>VU9XUVNURUEPGgMERQkMAggGQSUFBxADAhsaEkULEBoLGgEKJwUMAkg6GxUGCwoFSQUdFUVWVF5TTV5V</str></arr></lst><lst><arr
name="labels"><str>Failure Notice</str></arr><double
name="score">3.3896460608158754</double><arr
name="docs"><str>VU9XUVNURUEPGgMERQkMAggGQSUFBxADAhsaEkULEBoLGgEKJwUMAkg6GxUGCwoFSQUdFUVWVFxRRFpZ</str><str>VU9XUVNURUEPGgMERQkMAggGQSUFBxADAhsaEkULEBoLGgEKJwUMAkg6GxUGCwoFSQUdFUVWVFxTTV5V</str><str>VU9XUVNURUEPGgMERQkMAggGQSUFBxADAhsaEkULEBoLGgEKJwUMAkg6GxUGCwoFSQUdFUVWVF9fTF9X</str><str>VU9XUVNURUEPGgMERQkMAggGQSUFBxADAhsaEkULEBoLGgEKJwUMAkg6GxUGCwoFSQUdFUVWVF9fTVtT</str></arr></lst><lst><arr
name="labels"><str>Other Topics</str></arr><double
name="score">0.0</double><bool name="other-topics">true</bool><arr
name="docs"><str>VU9XUVNURUEPGgMERQkMAggGQSUFBxADAhsaEkULEBoLGgEKJwUMAkg6GxUGCwoFSQUdFUVWVFxXR1xZ</str><str>VU9XUVNURUEPGgMERQkMAggGQSUFBxADAhsaEkULEBoLGgEKJwUMAkg6GxUGCwoFSQUdFUVWVF5TQllT</str><str>VU9XUVNURUEPGgMERQkMAggGQSUFBxADAhsaEkULEBoLGgEKJwUMAkg6GxUGCwoFSQUdFUVWVF5WQVlX</str><str>VU9XUVNURUEPGgMERQkMAggGQSUFBxADAhsaEkULEBoLGgEKJwUMAkg6GxUGCwoFSQUdFUVWVF5WQF5Z</str></arr></lst></arr>
</response>

As you can see in the <arr name="docs"> scope there are only document ids
and I need also the name field for each doc.
Is it possible to do that in this SOLR-CARROT2 combination?
Regards, Milos
Reply | Threaded
Open this post in threaded view
|

Re: xml response from clustering component in solr

Stanislaw Osinski
Administrator
Hi Milos,

As you can see in the <arr name="docs"> scope there are only document ids
and I need also the name field for each doc.

This is by design, there's no point repeating the content of documents in the clusters section -- these are part of the standard Solr response. If you need the response in any other format (such as with extra fields copied to the clustering result), write an XSLT transform that will do the job for you (http://wiki.apache.org/solr/XsltResponseWriter).

Staszek

------------------------------------------------------------------------------
Master SQL Server Development, Administration, T-SQL, SSAS, SSIS, SSRS
and more. Get SQL Server skills now (including 2012) with LearnDevNow -
200+ hours of step-by-step video tutorials by Microsoft MVPs and experts.
SALE $99.99 this month only - learn more at:
http://p.sf.net/sfu/learnmore_122512
_______________________________________________
Carrot2-developers mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/carrot2-developers