Hi Mark,

Thanks a lot for your reply. I do not have much knowledge regarding xslt. 
Could you kindly specify how do i use xslt to extract relevant 
information. Also how can i drive solr response to a file. Any guidance 
regarding this would help.

Thanks and regards,
Romita 



From:   geeky2 <gee...@hotmail.com>
To:     solr-user@lucene.apache.org, 
Date:   11/20/2012 10:55 PM
Subject:        Re: is it possible to save the search query?



Hello,

i think you are asking two questions here - i'll see if i can give you 
some
simple examples for both

1) how can i pull data from a solr search result set and compare it to
another for analysis?

one way - might be to drive the results in to files and then use xslt to
extract relevant information.

here is an example xslt file that pulls specific fields from a result:

<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
<xsl:output method="text"/>
        <xsl:template match="response/result">
        <xsl:for-each select="doc">
                <xsl:text>[</xsl:text>
                <xsl:value-of select="str[@name='itemNo']"/>
                <xsl:text>]</xsl:text>
                <xsl:text>,</xsl:text>
                <xsl:value-of select="float[@name='score']"/>
                <xsl:text>,</xsl:text>
                <xsl:value-of select="int[@name='rankNo']"/>
                <xsl:text>,</xsl:text>
                <xsl:value-of select="int[@name='partCnt']"/>
                <xsl:text>&#10;</xsl:text>
        </xsl:for-each>
</xsl:template>
</xsl:stylesheet> 



2) how can i embed data in to a solr query, making it easier to do 
analysis
in the log files?

here is a simple example that "bookmarks" or brackets transactions in the
logs - used only during stress testing

#!/bin/bash

TYPE=$1
TAG=$2

if [ $TYPE == 1 ]
then
    # beginning
    curl -v
http://something:1234/boo/core1/select/?q=partImageURL%3A$
{TAG}-test-begin&version=2.2&start=0&rows=777indent=on
else
    # end
    curl -v
http://something:1234/boo/core1/select/?q=partImageURL%3A$
{TAG}-test-end&version=2.2&start=0&rows=777indent=on
fi


hopefully this will give you something to start with.

thx
mark




--
View this message in context: 
http://lucene.472066.n3.nabble.com/is-it-possible-to-save-the-search-query-tp4018925p4021315.html

Sent from the Solr - User mailing list archive at Nabble.com.

Reply via email to