OSDX connector

Status
Not open for further replies.

ImRaptor

Ars Scholae Palatinae
830
I've been trying to connect our desktops to our search server using an OSDX connector but cannot seem to get it work properly. As far as I can see I have it right, it is getting the correct number of results, but none of the information. I'm pretty sure I am missing something simple in the return tag or a declaration in the OSDX file, but I just can't see it.

Results back:
osdxResult.png



Here is a snippet of the RSS return on a search for Visa:
Code:
<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:opensearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0">
   <channel>
      <title>SearchBlox Search Results</title>
      <link/>
      <description/>
      <opensearch:totalResults>14</opensearch:totalResults>
      <opensearch:startIndex>1</opensearch:startIndex>
      <opensearch:itemsPerPage>14</opensearch:itemsPerPage>
      <atom:link rel="search" type="application/opensearchdescription+xml" href="http://example.com/opensearchdescription.xml"/>
      <opensearch:Query role="request" searchTerms="visa" startPage="1"/>
      <item>
         <title>Stmt of Visa Expenditures_FIN 2-2.xlt</title>
         <link>/O:/Rec/Financial/Stmt of Visa Expenditures_FIN 2-2.xlt</link>
         <description>...Stmt of Visa Expenditures_FIN 2-2.xlt Visa Expense Statement of Visa Expenditures Expenditures...</description>
      </item>
      <item>
         <title>Credit Card Guidelines_FIN 2-1.doc</title>
         <link>/O:/Rec/Financial/Credit Card Guidelines_FIN 2-1.doc</link>
         <description>... for obtaining missing receipts and may be held liable for them until produced. A  Statement of Visa......</description>
      </item>

And of course the OSDX code:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/">
  <ShortName>Internal Search v1.0</ShortName>
  <Description>OpenSearch via Windows 7 Search Federation.</Description>
  <Url type="application/rss+xml" template="http://searchblox:8080/searchblox/servlet/SearchServlet?query={searchTerms}"/>
</OpenSearchDescription>
 

ImRaptor

Ars Scholae Palatinae
830
Working on this was back burnered and now I am back to it again.

So far I am still not having any success getting this OSDX to behave properly.

OSDX connector
Code:
<?xml version="1.0" encoding="UTF-8"?>
<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/" xmlns:opensearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:ms-ose="http://schemas.microsoft.com/opensearchext/2009/"> 
	<ShortName>PAMI Search v1.1</ShortName>
	<Description>OpenSearch for PAMI via Windows 7 Search Federation.</Description>
	<Contact>jharmon@pami.ca</Contact>
	<Url type="application/rss+xml" template="http://search/searchblox/servlet/SearchServlet?query={searchTerms}"/>
	<Url type="text/html" template="http://search/searchblox/servlet/SearchServlet?action=Preview&amp;query={searchTerms}&amp;xsl=tabbed.xsl"/>
</OpenSearchDescription>

Using curl I can get my rss result back. Here is a search for "771 plan"
Code:
<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:opensearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:ms-ose="http://schemas.microsoft.com/opensearchext/2009/" version="2.0">
   <channel>
      <title>SearchBlox Search Results</title>
      <link>http://search.humboldt.pami.internal/</link>
      <description>PAMI Search2</description>
      <opensearch:totalResults>1</opensearch:totalResults>
      <opensearch:startIndex>1</opensearch:startIndex>
      <opensearch:itemsPerPage>1</opensearch:itemsPerPage>
      <atom:link rel="search" type="application/opensearchdescription+xml" href="http://example.com/opensearchdescription.xml"/>
      <opensearch:Query role="request" searchTerms="771 plan" startPage="1"/>
      <item>
         <title>771 - Quick reference Plan Member.pdf</title>
         <link>/O:/Personnel/Equitable Life Forms/771 - Quick reference Plan Member.pdf</link>
         <description>...771 - Quick reference Plan Member.pdf G r o u p B e n e f i t s Innovations Plan Member Web QUICK... Click Plan Member...</description>
      </item>
   </channel>
</rss>

I'm getting one result back, which is correct. But all that is coming through is the <No information available>, as shown in my first post.
Anyone have an idea what isn't working for this connector?
 

ImRaptor

Ars Scholae Palatinae
830
This is the XSL I am working with at the moment. I suspect my error is in here, but I just don't know. If I had much hair I would be pulling it out.

Code:
<?xml version='1.0' ?>

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:encode="java.net.URLEncoder" extension-element-prefixes="encode" version="1.0">

 <xsl:output method="xml" indent="yes" media-type="application/xml"/>

    <xsl:variable name="title">SearchBlox Search Results</xsl:variable>

    <xsl:template match="searchdoc">
     <rss version="2.0"
          xmlns:opensearch="http://a9.com/-/spec/opensearch/1.1/"
          xmlns:atom="http://www.w3.org/2005/Atom"
          xmlns:ms-ose="http://schemas.microsoft.com/opensearchext/2009/">
       <channel>
         <title><xsl:value-of select="$title"/></title>
         <link>http://search.humboldt.pami.internal/</link>
         <description>PAMI Search</description>
         <opensearch:totalResults> <xsl:value-of select="//results/@hits"/></opensearch:totalResults>
         <opensearch:startIndex><xsl:value-of select="//results/@start"/></opensearch:startIndex>
         <opensearch:itemsPerPage><xsl:value-of select="//results/@end - //results/@start + 1 "/></opensearch:itemsPerPage>
         <xsl:variable name="query" select="//searchform/@query"/>
         <xsl:variable name="cpage" select="//results/@currentpage"/>
         <opensearch:Query role="request" searchTerms="{$query}" startPage="{$cpage}" />
         <xsl:call-template name="results"/>
       </channel>
     </rss>
    </xsl:template>

    <xsl:template name="results">
        <xsl:for-each select="//result">
         <item>
           <title><xsl:apply-templates select="title"/></title>
           <link><xsl:value-of select="url"/></link>
           <description>
                <xsl:apply-templates select="description"/>
           </description>
         </item>
        </xsl:for-each>
    </xsl:template>

    <xsl:template match="title">
        <xsl:apply-templates/>
    </xsl:template>

    <xsl:template match="description">
        <xsl:apply-templates/>
    </xsl:template>

    <xsl:template match="context">
        <xsl:apply-templates/>
    </xsl:template>

</xsl:stylesheet>
 
Status
Not open for further replies.