tag:blogger.com,1999:blog-5021158862826396182024-02-20T08:40:25.192-08:00Mossman's FAST Search for Sharepoint BlogThe blog is dedicated to FAST Search for Sharepoint 2010 (F4SP) tips and tricks that I've learned.Boxout6http://www.blogger.com/profile/05908241600498435449noreply@blogger.comBlogger2125tag:blogger.com,1999:blog-502115886282639618.post-33375270838921892752011-07-21T20:24:00.001-07:002011-07-21T20:27:46.257-07:00Pipeline Extensibility - Logging<div style="font-family: "times new roman"; font-size: 9pt; margin: 0in;">The only current way to log information during the pipelining process is to write your file to the FAST service user's LocalLow directory. I usually use this to debug what information is coming into the pipeline when I am transforming it. </div><div style="font-family: Calibri; font-size: 11pt; margin: 0in;"><br />
</div><div style="font-family: "times new roman"; font-size: 9pt; margin: 0in;"><span style="color: #006699; font-weight: bold;">Imports</span> System</div><div style="font-family: "times new roman"; font-size: 9pt; margin: 0in;"><span style="color: #006699; font-weight: bold;">Imports</span> System.Collections.Generic</div><div style="font-family: "times new roman"; font-size: 9pt; margin: 0in;"><span style="color: #006699; font-weight: bold;">Imports</span> System.Linq</div><div style="font-family: "times new roman"; font-size: 9pt; margin: 0in;"><span style="color: #006699; font-weight: bold;">Imports</span> System.Xml.Linq</div><div style="font-family: "times new roman"; font-size: 9pt; margin: 0in;"><span style="color: #006699; font-weight: bold;">Imports</span> System.Text</div><div style="font-family: "times new roman"; font-size: 9pt; margin: 0in;"> </div><div style="font-family: "times new roman"; font-size: 9pt; margin: 0in;"><span style="color: #006699; font-weight: bold;">Namespace</span> Search</div><div style="font-family: "times new roman"; font-size: 9pt; margin: 0in;"> <span style="color: #006699; font-weight: bold;">Class</span> PipelineLogger</div><div style="font-family: "times new roman"; font-size: 9pt; margin: 0in;"> </div><div style="font-family: "times new roman"; font-size: 9pt; margin: 0in;"> <span style="color: #006699; font-weight: bold;">Shared</span> <span style="color: #006699; font-weight: bold;">Sub</span> Main(<span style="font-weight: bold;">ByVal</span> args <span style="font-weight: bold;">As</span> <span style="color: #006699; font-weight: bold;">String</span><span style="color: black;">())</span></div><div style="font-family: "times new roman"; font-size: 9pt; margin: 0in;"> </div><div style="color: #008200; font-family: "times new roman"; font-size: 9pt; margin: 0in 0in 0in 0.375in;">'Log the input doc </div><div style="color: black; font-family: "times new roman"; font-size: 9pt; margin: 0in 0in 0in 0.375in;">WriteOutInputFile(args(0), args(1))</div><div style="font-family: "times new roman"; font-size: 9pt; margin: 0in;"> </div><div style="font-family: "times new roman"; font-size: 9pt; margin: 0in;"> <span style="color: #006699; font-weight: bold;">End</span> <span style="color: #006699; font-weight: bold;">Sub</span></div><div style="font-family: "times new roman"; font-size: 9pt; margin: 0in;"> </div><div style="font-family: "times new roman"; font-size: 9pt; margin: 0in;"> <span style="color: #008200;">' Write the input file to a location the application has access to write in.</span></div><div style="font-family: "times new roman"; font-size: 9pt; margin: 0in;"> <span style="color: #006699; font-weight: bold;">Private</span> <span style="color: #006699; font-weight: bold;">Shared</span> <span style="color: #006699; font-weight: bold;">Sub</span> WriteOutInputFile(<span style="font-weight: bold;">ByVal</span> inputFile <span style="font-weight: bold;">As</span> <span style="color: #006699; font-weight: bold;">String</span><span style="color: black;">, </span><span style="color: #006699; font-weight: bold;">ByVal</span> username <span style="font-weight: bold;">As</span> <span style="color: #006699; font-weight: bold;">String</span><span style="color: black;">)</span></div><div style="font-family: "times new roman"; font-size: 9pt; margin: 0in;"> </div><div style="font-family: "times new roman"; font-size: 9pt; margin: 0in 0in 0in 0.375in;"><span style="color: #006699; font-weight: bold;">Dim</span> localLow <span style="font-weight: bold;">As</span> <span style="color: #006699; font-weight: bold;">String</span> = "c:\users\" & username & "\appdata\LocalLow"</div><div style="font-family: "times new roman"; font-size: 9pt; margin: 0in;"> </div><div style="font-family: "times new roman"; font-size: 9pt; margin: 0in 0in 0in 0.375in;"><span style="color: #006699; font-weight: bold;">Dim</span> pipelineInputData <span style="font-weight: bold;">As</span> <span style="color: #006699; font-weight: bold;">String</span> = IO.Path.Combine(localLow, "PipelineExtensibilityLog")</div><div style="color: black; font-family: "times new roman"; font-size: 9pt; margin: 0in 0in 0in 0.375in;">IO.Directory.CreateDirectory(pipelineInputData) </div><div style="font-family: "times new roman"; font-size: 9pt; margin: 0in 0in 0in 0.375in;"><br />
<span style="color: #006699; font-weight: bold;">Dim</span> outFile <span style="font-weight: bold;">As</span> <span style="color: #006699; font-weight: bold;">String</span> = IO.Path.Combine(pipelineInputData, DateTime.Now.ToString("yyyyMMddHHmmss.ffff") & ".xml")</div><div style="color: black; font-family: "times new roman"; font-size: 9pt; margin: 0in 0in 0in 0.375in;">IO.File.Copy(inputFile, outFile)</div><div style="font-family: "times new roman"; font-size: 9pt; margin: 0in;"> </div><div style="color: #006699; font-family: "times new roman"; font-size: 9pt; margin: 0in 0in 0in 0.375in;"><span style="font-weight: bold;">Return</span></div><div style="font-family: "times new roman"; font-size: 9pt; margin: 0in;"> <span style="color: #006699; font-weight: bold;">End</span> <span style="color: #006699; font-weight: bold;">Sub</span></div><div style="font-family: "times new roman"; font-size: 9pt; margin: 0in;"> </div><div style="font-family: "times new roman"; font-size: 9pt; margin: 0in;"> <span style="color: #006699; font-weight: bold;">End</span> <span style="color: #006699; font-weight: bold;">Class</span></div><div style="font-family: "times new roman"; font-size: 9pt; margin: 0in;"><span style="color: #006699; font-weight: bold;">End</span> <span style="color: #006699; font-weight: bold;">Namespace</span></div><div style="font-family: "times new roman"; font-size: 9pt; margin: 0in;">Then in the %FASTSEARCH%\etc\pipelineextensibility.xml I input the fields that I wish to debug:</div><div style="font-family: "times new roman"; font-size: 9pt; margin: 0in;">(MOSS2010.Search is the user running the FAST service)</div><div style="font-family: Calibri; font-size: 11pt; margin: 0in;"><span style="color: black;"><</span><span style="color: #006699; font-weight: bold;">Run</span> <span style="color: grey;">command</span><span style="color: black;">=</span><span style="color: blue;">"C:\FASTSearch\etc\PipelineLogger\PipelineLogger.exe %(input)s MOSS2010.Search </span><span style="color: black;">></span></div><div style="font-family: "times new roman"; font-size: 9pt; margin: 0in;"> <<span style="font-weight: bold;">Input</span>></div><div style="font-family: "times new roman"; font-size: 9pt; margin: 0in;"> <<span style="font-weight: bold;">CrawledProperty</span> <span style="color: grey;">propertySet</span><span style="color: black;">=</span><span style="color: blue;">"d1b5d3f0-c0b3-11cf-9a92-00a0c908dbf1"</span> <span style="color: grey;">varType</span><span style="color: black;">=</span><span style="color: blue;">"31"</span> <span style="color: grey;">propertyName</span><span style="color: black;">=</span><span style="color: blue;">"VIEWS"</span><span style="color: black;">/></span></div><div style="font-family: "times new roman"; font-size: 9pt; margin: 0in;"> <<span style="font-weight: bold;">CrawledProperty</span> <span style="color: grey;">propertySet</span><span style="color: black;">=</span><span style="color: blue;">"11280615-F653-448F-8ED8-2915008789F2"</span> <span style="color: grey;">varType</span><span style="color: black;">=</span><span style="color: blue;">"31"</span> <span style="color: grey;">propertyName</span><span style="color: black;">=</span><span style="color: blue;">"url"</span><span style="color: black;">/></span></div><div style="font-family: "times new roman"; font-size: 9pt; margin: 0in;"> </<span style="font-weight: bold;">Input</span>></div><div style="font-family: "times new roman"; font-size: 9pt; margin: 0in;"> <<span style="font-weight: bold;">Output</span>></div><div style="font-family: "times new roman"; font-size: 9pt; margin: 0in;"> </<span style="font-weight: bold;">Output</span>></div><div style="font-family: Calibri; font-size: 11pt; margin: 0in;"><span style="color: black;"></</span><span style="color: #006699; font-weight: bold;">Run</span><span style="color: black;">></span></div>Boxout6http://www.blogger.com/profile/05908241600498435449noreply@blogger.com0tag:blogger.com,1999:blog-502115886282639618.post-49584943837458187472011-07-21T20:22:00.000-07:002011-07-21T20:30:08.951-07:00Pipeline Extensibility - Checking for a ValueThis post is going to cover an interesting quirk I have found when you attempt to retrieve the value of a web property (non-Sharepoint) in the pipeline extensibility. <br />
<div style="font-family: Calibri; font-size: 11pt; margin: 0in;">Say for example you have a web page with the meta tag of COST. </div><span style="background: none repeat scroll 0% 0% white; color: blue;"><span style="color: black;"> </span></span><br />
<div style="font-family: "times new roman"; font-size: 10pt; margin: 0in;"><span style="background: none repeat scroll 0% 0% white; color: blue;"><</span><span style="background: none repeat scroll 0% 0% white; color: maroon;">meta</span><span style="background: none repeat scroll 0% 0% white; color: red;"> name</span><span style="background: none repeat scroll 0% 0% white; color: blue;">="</span><span style="background: none repeat scroll 0% 0% white; color: black;">COST</span><span style="background: none repeat scroll 0% 0% white; color: blue;">"</span><span style="background: none repeat scroll 0% 0% white; color: red;"> content</span><span style="background: none repeat scroll 0% 0% white; color: blue;">="</span><span style="background: none repeat scroll 0% 0% white; color: black;">2000</span><span style="background: none repeat scroll 0% 0% white; color: blue;">"></span></div><div style="font-family: Calibri; font-size: 11pt; margin: 0in;">When the value come into your custom pipelineextensibility .exe it will look like this:</div><br />
<div style="font-family: "times new roman"; font-size: 10pt; margin: 0in;"><span style="background: none repeat scroll 0% 0% white; color: blue;"><</span><span style="background: none repeat scroll 0% 0% white; color: maroon;">CrawledProperty</span><span style="background: none repeat scroll 0% 0% white; color: red;"> propertySet</span><span style="background: none repeat scroll 0% 0% white; color: blue;">="</span><span style="background: none repeat scroll 0% 0% white; color: black;">d1b5d3f0-c0b3-11cf-9a92-00a0c908dbf1</span><span style="background: none repeat scroll 0% 0% white; color: blue;">"</span><span style="background: none repeat scroll 0% 0% white; color: red;"> varType</span><span style="background: none repeat scroll 0% 0% white; color: blue;">="</span><span style="background: none repeat scroll 0% 0% white; color: black;">31</span><span style="background: none repeat scroll 0% 0% white; color: blue;">"</span><span style="background: none repeat scroll 0% 0% white; color: red;"> propertyName</span><span style="background: none repeat scroll 0% 0% white; color: blue;">="</span><span style="background: none repeat scroll 0% 0% white; color: black;">COST</span><span style="background: none repeat scroll 0% 0% white; color: blue;">"></span><span style="background: none repeat scroll 0% 0% white; color: black;">2000 2000</span><span style="background: none repeat scroll 0% 0% white; color: blue;"></</span><span style="background: none repeat scroll 0% 0% white; color: maroon;">CrawledProperty</span><span style="background: none repeat scroll 0% 0% white; color: blue;">></span></div><br />
<div style="font-family: Calibri; font-size: 11pt; margin: 0in;">Notice that the value is shown twice in the property. The character that separates these values is the &H2029 (unicode paragraph seperator).</div><br />
<div style="font-family: Calibri; font-size: 11pt; margin: 0in;">In order to work around this, you split the value based on that character.</div><div style="font-family: Calibri; font-size: 11pt; margin: 0in;"><br />
</div><div style="font-family: Calibri; font-size: 11pt; margin: 0in;"><span style="color: #006699; font-weight: bold;">Dim</span> cArray <span style="font-weight: bold;">As</span> <span style="color: #006699; font-weight: bold;">Char</span><span style="color: black;">() = {ChrW(&H2029)}</span></div><br />
<div style="font-family: Calibri; font-size: 11pt; margin: 0in;"><span style="color: #006699; font-weight: bold;">Dim</span> postCategoryValueArray <span style="font-weight: bold;">As</span> <span style="color: #006699; font-weight: bold;">String</span><span style="color: black;">() = catXE.Value.Trim().Split(cArray, System.StringSplitOptions.RemoveEmptyEntries)</span></div><br />
<div style="font-family: Calibri; font-size: 11pt; margin: 0in;"><span style="color: #006699; font-weight: bold;">Dim</span> propValue <span style="font-weight: bold;">As</span> <span style="color: #006699; font-weight: bold;">String</span> = postCategoryValueArray(0)</div>Boxout6http://www.blogger.com/profile/05908241600498435449noreply@blogger.com0