Display search results for correct keyword in case of mispelling

9 views
Skip to first unread message

swati maini

unread,
May 15, 2012, 10:49:16 AM5/15/12
to Google-Search-...@googlegroups.com


We have a requirement where if a user types a keyword with incorrect spelling, search results will be returned based on the 'correct' keyword and a message gets displayed as "Search for <wrong keyword> keyword instead. and If a user types complete gibberish, then no results page is displayed.

For ex if a user types for "mobiel", search results are displayed for keyword "mobile" and a message gets displayed "Search for ''mobiel' instead: 0 results".

In search results XML, GSA returns <suggestion> element, which gives the correct keyword. We tried, if no results are returned and <suggestions> element is returned in the result XML, then another query is fired with the keyword in the <suggestion> element, and if no results results are returned and no <suggestion> element is returned, then no results page is displayed to the user.

We dont want to hit multiple queries and there can be a possibility of multiple words being returned in the <suggestion> element.

Is there any way/configuration where we can tell GSA to search for the correct keyword, in case of any spell error ?

Thanks!!

SwatiM

unread,
May 17, 2012, 3:12:01 PM5/17/12
to Google-Search-...@googlegroups.com
Anyone worked on this use case ever before. Any help will be appreciated.

Thanks!

Edwin Stauthamer

unread,
May 17, 2012, 3:32:18 PM5/17/12
to Google Search Appliance/Google Mini - Google Search Appliance/Google Mini
I have implemented this for a dutch consumer organisation.

We have not used the onboard XSL interface for this but instead of
that implemented this in PHP (but you could use any programming
language).

Simply get the results (HTTP call), check to see if there are 0
results returned or if there is a suggestion in the GSA response XML.

If so, do a new call to the GSA with the other word.

Mayby you could implemented this with some Ajax scripting in the
onboard XSL, but this will be less easy.

SwatiM

unread,
May 17, 2012, 3:39:07 PM5/17/12
to Google-Search-...@googlegroups.com
Thx for the reply.
We tried this approach. Is there any way where we can avoid double query?
At the same time, is there any possibilty that there could be more than one suggestion in response xml?

Dave Watts

unread,
May 19, 2012, 12:15:26 PM5/19/12
to google-search-...@googlegroups.com
> We tried this approach. Is there any way where we can avoid double query?

No.

> At the same time, is there any possibilty that there could be more than one suggestion in response xml?

To answer this sort of question, your best bet is the documentation
and the DTD. According to the 6.14 documentation, only one spelling
suggestion is provided:

https://developers.google.com/search-appliance/documentation/614/xml_reference#tag_spelling

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
http://training.figleaf.com/

Fig Leaf Software is a Veteran-Owned Small Business (VOSB) on
GSA Schedule, and provides the highest caliber vendor-authorized
instruction at our training centers, online, or onsite.

swati maini

unread,
May 19, 2012, 2:54:22 PM5/19/12
to google-search-...@googlegroups.com
Thanks!!


--
You received this message because you are subscribed to the Google Groups "Google Search Appliance/Google Mini" group.
To post to this group, send email to Google-Search-...@googlegroups.com.
To unsubscribe from this group, send email to Google-Search-Applia...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/Google-Search-Appliance-Help?hl=en.


Reply all
Reply to author
Forward
0 new messages