mswin

Hi,

In MOSS search center when the user inputs some text and clicks on search button the search results will be displayed. Is there a way to view the query that sharepoint is firing to get the search results in Profiler or in some trace

Thanks in Advance,

mswin



Re: SharePoint - Search Viewing the search query upon Search button click in MOSS...

Mitch Prince (MSFT)

To see the Search SQL query that's sent to the search engine from advanced search, after you submit your search query, right click ont he page in IE and select "view source" and search for "QueryText".

The keyword query that you enter into simple search is the query sent to the search engine.

- Mitch





Re: SharePoint - Search Viewing the search query upon Search button click in MOSS...

mswin

Mitch,

Thanks for the reply.

As suggested I am able to find the search query for the advanced search in the View Source.

But when I tried to find the same for Simple search, I didn't find anything like this and the querytext for simple search is showing simply the search input.

Is there a way to view the query that simple search is using

Also I had an issue with fretext query; For the same search input , search results count is differing when executed from the MOSS simple search and when executed from the freetext query from object model code . Is there any setting that we need to do to get all the results returned from Sharepoint OM

Here is the query that is used from code:

"SELECT Title, Rank, FROM Scope() WHERE FREETEXT('enterprise search') AND \"scope\" = 'myscope' ";

Thanks in Advance.

Regards,

mswin





Re: SharePoint - Search Viewing the search query upon Search button click in MOSS...

Mitch Prince (MSFT)

I should have been a little more clear. When you submit a simple search, you are submitting a keyword search. This uses the keyword query syntax. When you use the advance search it uses the SQL query syntax. The query that's submitted for a simple search is exactly what the user has typed into the search box.

In the example you provided, the keyword search query would be:

enterprise search scope:myscope

Based on your query, I'm assuming that you entered query with the two words (enterprise and search) in the "All of these words" box and selected the scope myscope (you changed the web part property to expose the search scopes)

In the simple search box we use an implicit AND operator. This query would find documents where both words exist. Keep in mind that this is different than if you surrounded these two keywords in one set of double quotes ("enterprise search") which would find documents with that exact phrase in your scope.

- Mitch





Re: SharePoint - Search Viewing the search query upon Search button click in MOSS...

mswin

Thanks for the detailed explanation.

Can we change the implicit And behavior of simple search. When I input enterprise search as search input I want to find the documents where at least one of the word (enterprise or search exists).

Regards,

mswin