In most of the cases, you will end-up building your own search application for Google Search Appliance. The built-in stylesheet XSLT is nice but typically the front-end requirements are more complicated than the XSLT can accomodate (I am sure that some high-end XSLT experts will not agree with this statement).

So, you can pretty easily develop your own search app, using the Search Protocol API the GSA provides. All you need to do is to POST HTTP request with your query parameters and the GSA will respond with XML output enumerating all your results.

Having said that, the built-in XSLT editor have a very neat feature called Dynamic Navigation. This is Google's version of Parametric Search allowing to run a broad query and then to filter the search results by various parameters (usually metadata).

When building your own search app, you often would like to implement your own "Dynamic Navigation", however the documentation lacking any reference to how to do that... The obvious choice is to send several queries to the GSA, finding out what parameters are available, but this will be very inefficient and require multiple round-trips between your app and the GSA.

Apparently, I've found that in the search result XML, there is a <PARM> section which includes the complete dictionary of Dynamic Navigation for a given search.

Let's look closer into the search result XML, - if you have enabled and configured Dynamic Navigation for your front-end, your XML response will include something similar to this: 

<PARM>
<PC>0</PC>
<PMT NM="categoryName" DN="Category" IR="0" T="0">
<PV V="Category 1"   L="" H="" C="253"/>
<PV V="Category 2"" H="" C="244"/>
<PV V="Category 3"   L="" H="" C="158"/>
<PV V="Category 4"   L="" H="" C="91"/>
</PMT>
<PMT NM="Visibility" DN="Access Level" IR="0" T="0">
<PV V="Public" L="" H="" C="931"/>
<PV V="Private" L="" H="" C="390"/>
</PMT>


<PMT NM="views" DN="Popularity" IR="1" T="1">
<PV V="" L="" H="0" C="0"/>
<PV V="" L="1" H="500" C="1256"/>
<PV V="" L="501" H="1000" C="58"/>
<PV V="" L="1001" H="3000" C="5"/>
<PV V="" L="3001" H="5000" C="2"/>
<PV V="" L="5001" H="" C="0"/>
</PMT>
</PARM>

In my Dynamic Navigation configuration, I have three parameters, - "Category" and "Access Level"  and "Popularity" based on metadata (from database in my case) of "categoryName", "Visibility" and "Views" accordingly.

Obviously enough, "C" attribute is count (i.e. how many search results have this metadata), "L" is lower-end range definition and "H" is higher-end range definition.

Now, all you need is to load and parse this section of XML and build your own UI around it. Isn't that awesome?
Posted
AuthorVadim Solovey