With FAST for SharePoint being so new, itâ€™s difficult to know how to work with the product when it comes to debugging. There are many different questions:
- What does it know about document x?
- What is FAST returning to my SharePoint server?
- What is the rank of a certain document?
- What is SharePoint asking FAST?
- Why aren’t User Contexts working? Are User Contexts working?
For all of these questions, the QRServer is an invaluable tool.
What is the QR Server?
The Query Result (QR) Server, is a way to speak with FAST directly, without worrying about SharePoint. It’s a web site, accessible only to usersÂ logged in to the FAST server that allows users to fire queries into FAST and see the resulting XML. This is important because it allows users to rule-out (or in) SharePoint as the culprit for broken searches.
By default, the QR Server respects content security rules, so using different accounts on the QR Server will give you different results.
How do I find my QR Server?
You access the QR Server via a web-browser. The url to type is http://<fastservername>:<basePortNumber+280>/. So letâ€™s say the ever popular contoso.com is served by a FAST server with the name http://fsContoso1.controso.com using the default base port number of 13000. In that case youâ€™d need to navigate to http://fsContoso1.controso.com:13280.
The QR Server is ONLY accessible directly from a FAST server, so you must Remote Desktop onto the server to use it. From there, you find your base port number by looking at the hostconfiguration.xml in the < FASTInstallLocation>/etc/ folder
The FAST Query Game
Debugging queries in a production or UAT environment is a serious pain. This technique was taught to me by a FAST Ninja (thanks Torstein!) and is a bit bizarre. It involves running a query from SharePoint and then extracting the data passed to FAST out of a log file and manually resubmitting the query on the FAST server, all within 15 seconds.
This approach is necessary because along with your query, SharePoint sends FAST Â a user authorization token that is only valid for a short period of time.
- You must be logged into the FAST server
- Open Windows Explorer and navigate to <FASTInstallLocation>/var/logs/querylogs/. Find the most recently modified file.
- Open a copy of NotePad (or your favourite text editor)
- On the FAST server, open a web browser and navigate to the QR Server.
- Search for the term “test”
- Open a web browser and navigate to the SharePoint search UI.
- At this stage you will have 1x Notepad, 1x Windows Explorer, 2x Web browsers
- You must execute your queries from the SharePoint server, via the UI
- You have 15 seconds to complete the following process… or you dieâ€¦ probably.
STEPÂ 1: On your SharePoint FAST Search Centre, execute your query
STEPÂ 2: Quickly switch to the FAST server and into the the FAST log folder. Open the most recent log file in Notepad and navigate to the bottom, making sure Word Wrap is on.
STEP 3: Take the last url in the file
You will need to grab the url from theÂ querystring, taking everything after â€œsearch?â€ until the HTTP/1.1 text. In a production environment this can span multiple lines and be tricky to select within the 15 second limit. This is usually the part where I run out of time.
STEP 4: On the QR Server, paste the querystring into the location noted below
STEP 5: Hit “go”, “enter” or whatever to start your search and see the results FAST sent back to SharePoint
If you run out of time, youâ€™ll see the same QUERYTRANSFORMS elements, but nothing else.
Interpreting the results
Following a successful round of the FAST Debugging game, you can investigate the results. I can’t possibly describe each element, but at a high-level:
- QUERYTRANSFORMS Ã Describes what was submitted through SharePoint. Refiner selections, user contexts, sorting selections will all appear here.
- NAVIGATION Ã Indicate what refinement data is being sent back to the server. Useful when the number of displayed refiners seems incorrect.
- RESULTSET Ã Includes all the search hits from the current â€œpageâ€, including the value of every managed property (i.e. attributes of a document that FAST gives special treatment). While it doesnâ€™t give you a way to interrogate every crawled property you also get to look at the rank of a document
- PAGENAVIGATION Ã If you work in Collaboration youâ€™re smart enough to figure this out.
I’ll talk more about interpreting the results in my next post, but for now, I hope this helps.