Sharepoint 2010 search: How to modify search query before submit (programmatically?)

Posted by palgo on Stack Overflow See other posts from Stack Overflow or by palgo
Published on 2010-12-28T10:00:22Z Indexed on 2010/12/28 17:54 UTC
Read the original article Hit count: 186

Filed under:
|
|

Hi,

I'm making a custom search box Web Part, similar to the OOTB Web Part from SharePoint (SearchBoxEx class).

I'm interested in modifying the search query with additional text before it is submitted, based on a custom checkbox added on the Web Part.

Any help on how I can achieve this?

UPDATE:

I've used the AppendToQuery and AppQueryTerms properties, but this will rewrite the text in the search box as well. I'm interested in passing the values "in the background", maybe as an extra parameter. Point is that the query modification should happen without the user seeing it explicitly.

© Stack Overflow or respective owner

Related posts about search

Related posts about sharepoint2010