beautypg.com

Query suggestion, Query suggestion blacklist – Google Search Appliance Administrative API Developers Guide: Java User Manual

Page 40

background image

Google Search Appliance: Administrative API Developer’s Guide: Java

40

The following example updates related queries:

// Create an entry to hold properties to update
GsaEntry updateEntry = new GsaEntry();
updateEntry.setId("myFrontend");
updateEntry.addGsaContent("updateMethod", "update");

// Set the starting line number
updateEntry.addGsaContent("startLine", 0);

// Provide the original content
String originalLines = "airplane,aircraft\ngoogle,googol";
updateEntry.addGsaContent("originalLines", originalLines);

// Prepare new content
String newLines = "airplane,helicopter\n,";
updateEntry.addGsaContent("newLines", newLines);

// Send the request to the search appliance
myClient.updateEntry("synonym", "myFrontend", updateEntry);

Note: Delete a setting by changing the statement to a comma (,) value.

The following example replaces related queries:

// Create an entry to hold properties to replace
GsaEntry replaceEntry = new GsaEntry();
replaceEntry.setId("myFrontend");
replaceEntry.addGsaContent("updateMethod", "replace");

// Prepare new content
String newLines = "airplane,aircraft\n" + "google,googol\n" + "stock,security";
replaceEntry.addGsaContent("newLines", newLines);

// Send the request to the search appliance
myClient.updateEntry("synonym", "myFrontend", replaceEntry);

Query Suggestion

There are two features for working with query suggestions:

“Query Suggestion Blacklist” on page 40

“Query Suggestion Refresh” on page 41

Query Suggestion Blacklist

The query suggestion blacklist supports the /suggest feature described in the “Query Suggestion Service
/suggest Protocol” chapter of the Search Protocol Reference. This feature uses the suggest feed to
retrieve and update the query suggestion blacklist entries.

Property

Description

suggestBlacklist

Content of the suggest blacklist file.