ANY search via the Search Query Tool returns ALL rows

Jun 29, 2016 at 12:30 PM
Search is working normally in the SharePoint environment (e.g., via SearchCenter). But through the tool, no matter which string I enter, or which check boxes I check or uncheck, the tool returns 896809 rows!

Only recent changes to my environment involve the fact that I was tinkering with trying to enable kerberos authentication for a third party app that uses C2wts (Claims to Windows Token Service).

Any ideas on why the tool is now over-returning results? (And yes--I reset the tool, ensured that I didn't have any settings left checked or unchecked, etc. Even installed the tool on another machine with a clean, default config to confirm that I experience the same behavior.)

Thanks, in advance, for your help!
Jun 29, 2016 at 12:39 PM
Can you please list the output of Query Modification on the status tab after you search.
Jun 29, 2016 at 12:59 PM
HTTP/1.1 200 OK
Serialized Query:
<Query Culture="en-US" EnableStemming="True" EnablePhonetic="False" EnableNicknames="False" IgnoreAllNoiseQuery="True" SummaryLength="180" MaxSnippetLength="180" DesiredSnippetLength="90" KeywordInclusion="0" QueryText="fish" QueryTemplate="" TrimDuplicates="True" Site="<MYSITEGUIDETC>..."KeywordType="True" HiddenConstraints="" />
Jun 29, 2016 at 1:08 PM
Edited Jun 29, 2016 at 1:09 PM
No.. in v2.5 of the query tool it lists the actual query in a property called "Query Modification", on the Status tab after you search. Not the query you send in, but what is part of the returned response.

So a bit further down.. last row actually on the Status tab. Something like:

Query Modification: foo -ContentClass=urn:content-class:SPSPeople
Jun 29, 2016 at 1:12 PM
I'm using 2.3. I'll download 2.5 . . .
Jun 29, 2016 at 1:17 PM
Same behavior with the 2.5 tool. Glad I didn't waste everyone's time. Here is what you were asking for:

Query Modification: (FileExtension:doc OR FileExtension:docx OR FileExtension:xls OR FileExtension:xlsx OR FileExtension:ppt OR FileExtension:pptx OR FileExtension:pdf) (IsDocument:"True" OR contentclass:"STS_ListItem")
Jun 29, 2016 at 1:24 PM
WolfDev wrote:
Same behavior with the 2.5 tool. Glad I didn't waste everyone's time. Here is what you were asking for:

Query Modification: (FileExtension:doc OR FileExtension:docx OR FileExtension:xls OR FileExtension:xlsx OR FileExtension:ppt OR FileExtension:pptx OR FileExtension:pdf) (IsDocument:"True" OR contentclass:"STS_ListItem")
There's your answer right there.. you have a default result source most likely which set's that query without having {searchTerms} as part of the template. You have a query listing all file types and list items.
Marked as answer by WolfDev on 6/30/2016 at 7:14 AM
Jun 29, 2016 at 1:55 PM
Huh. Interesting. I think I was messing with Result Sources, too. But I'd have thought any changes there would also have affected the results I am receiving when doing a search directly in SharePoint. And that's not happening. I'll add back in {searchTerms} and see if that fixes things. Thanks for the pointer. I'll let you know how I make out!
Jun 29, 2016 at 2:03 PM
WolfDev wrote:
Huh. Interesting. I think I was messing with Result Sources, too. But I'd have thought any changes there would also have affected the results I am receiving when doing a search directly in SharePoint. And that's not happening. I'll add back in {searchTerms} and see if that fixes things. Thanks for the pointer. I'll let you know how I make out!
Not really as your web parts most likely target a specific result source - thus not hitting this. If you in the query tool specify a result source, you should most likely see results as expected.
Jun 29, 2016 at 5:59 PM
So . . . it's definitely behaving more predictably now. Thank you!

As a follow-up, I tried to create a new result source with a query of simply "{searchTerms}"--and nothing more, in the hopes that this new "broad" result source query would include results from my two new content sources. But the new Result Source ("Everything") does not appear in the Result Source drop-down list in the Search Tool. Is there anything special I have to do to ensure that the new Result Source is populated in that drop-down? (Also, if I set "Everything" as the default result source, I am not returning any of the results I expect from the new content sources either...)
Jun 29, 2016 at 8:40 PM
Last follow-up . . . once I made my new result source the DEFAULT, it DOES now return results in the SP Search Tool.

But I am still not seeing the new Result Sources in my drop-down, FYI.
Jun 29, 2016 at 8:44 PM
The result sources are static within the query tool - you have to get the id from the sharepoint page and paste it to drop down. Inconvenient, but works.

Glad it works now!
Max
Jun 30, 2016 at 7:24 AM
You don't have to use the id for a result source. You can use the name as well as well as the scope level it was created on. Hit the help icon next to the box and you will see an example :) Or hover the mouse over the box for a tooltip.

SPSite|My source
SPWeb|My source
SSA|My source
Jun 30, 2016 at 2:37 PM
Thank you Max and Wobba! Will try those approaches out when I have a chance!
Jun 30, 2016 at 3:16 PM
Final post . . . that SPSite:My source trick is great! Thank you!