Search code examples
google-search-appliance

Query Expansion / Synonyms when using POST Method


The situation

Our Google Search Appliance (Software Version: 7.2.0.G.112) is setup to expand queries using a custom synonyms file containing for example this entry: {men, mens}

The problem

The search appliance appears to use these synonyms when responding to a GET request but not when responding to a POST request. See the table below

+-----------------+-------------+----------------+-----------+
|  Request Type   |    Query    |  Result Count  |   Good?   |
+-----------------+-------------+----------------+-----------+
|  GET            |    mens     |  705           |    yes    |
|  POST           |    mens     |  691           |    yes    |
|  GET            |    men      |  706           |    yes    |
|  POST           |    men      |  88            |    no     |
+-----------------+-------------+----------------+-----------+

The Question

How can I enable the query expansion/ synonyms for the POST request so it will return (approximately) the same results.

The Requests in Detail

Get Request

GET /search?q=men&output=xml_no_dtd&client=default_frontend&
   getfields=*&filter=0&start=0&num=25&site=some_value&
   requiredfields=(-core__isblocked.core__brandid:brand.
   (core__catalog:163%252D2101|(inv__0104|inv__3301))) HTTP/1.1
Host: xxx.xxx.xxx.xxx:80
Cache-Control: no-cache

Post Request

POST /search HTTP/1.1
Host: xxx.xxx.xxx.xxx
Content-Type: application/x-www-form-urlencoded
Content-Length: 242
Cache-Control: no-cache

q=men&output=xml_no_dtd&client=default_frontend&
getfields=*&filter=0&start=0&num=2&site=some_value&
requiredfields=(-core__isblocked.core__brandid:brand.
(core__catalog:163%2D2101|(inv__0104|inv__3301)))

Bonus question: why is the result for GET and POST for "mens" also different.


Solution

  • You can set "Query Expansion Policy" in the frontend. Are you sure you are using the the same frontend for both the queries. In my knowledge, the GET/POST method should not affect the search result.

    Why isn't stackflow allowing me to add a comment to the question. Gosh..

    UPDATE

    Also, core__catalog:163 -- THis value is different in the GET and POST. Might be something to do with the character encoding/decoding? Can you remove all those requiredfields and just supply 'q' and look for the count?