简体   繁体   English

C#应用程序查询Search Server Express 2010

[英]C# application to query Search Server Express 2010

I have been playing around with Search Server Express 2010 and have built up a little windows application in C# to attempt to query the server and return some results. 我一直在使用Search Server Express 2010,并在C#中构建了一个小Windows应用程序以尝试查询服务器并返回一些结果。 Whenever i attempt to run the query i receive the error "The search request was unable to connect to the Search Service." 每当我尝试运行查询时,都会出现错误“搜索请求无法连接到搜索服务”。

My query is below. 我的查询如下。 I have also tried a query of type MSSQLFT. 我还尝试了MSSQLFT类型的查询。

<QueryPacket xmlns='urn:Microsoft.Search.Query'>
   <Query>
  <SupportedFormats>
     <Format revision='1'> urn:Microsoft.Search.Response.Document:Document</Format>
  </SupportedFormats>
  <Context>
     <QueryText language='en' type='FQL'>
     </QueryText>
  </Context>
  <ResultProvider>FASTSearch</ResultProvider>
  <Range>
     <Count>10</Count>
  </Range>
   </Query>
</QueryPacket>

Neither of my query attempts have worked and both got the same error and nothing i am searching for is assisting with a solution. 我的查询尝试均无济于事,并且均出现相同的错误,我正在寻找的任何东西都无法协助解决方案。

I have deliberately broke it in other ways by taking the search server offline, creating an error in the search, etc. and they all give me different errors, so i am thinking the query does actually reach the server ok! 我通过使搜索服务器脱机,在搜索中创建错误等方式故意破坏了它,它们都给了我不同的错误,所以我认为查询确实可以到达服务器了! (Also i am sure i have permissions correct) (我也确信我的权限正确)

Does anyone have any thoughts? 有人有想法吗? Am i actually even able to search the express version of search server in this manner? 我实际上是否能够以这种方式搜索搜索服务器的快速版本?

Any assistance would be greatly appreciated. 任何帮助将不胜感激。

Cheers 干杯

Ok, simple, as it turns out FQL wont work with 2010 express, and is obvious now i think about it (lack of initial research i guess). 好吧,很简单,因为事实证明FQL不能与2010 Express一起使用,并且现在我想起来很明显(我想缺少初步研究)。 When i used MSSQLFT query type i accidentally left the 当我使用MSSQLFT查询类型时,我不小心离开了

<ResultsProvider>FastSearch</ResultsProvider>

line in there. 排在那里。 This was causing the error i was getting. 这是导致我得到的错误。

The query that worked for me was 对我有用的查询是

<QueryPacket xmlns='urn:Microsoft.Search.Query'>
<Query>
<SupportedFormats>
<Format>urn:Microsoft.Search.Response</Format>
</SupportedFormats>
<Context>
<QueryText language='en' type='MSSQLFT'>
SELECT Filename, Title, FileExtension, Path from Scope()
</QueryText>
</Context>
<Range>
<Count>10</Count>
</Range>
</Query>
</QueryPacket>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM