How to use the search.asmx service to search a particular library?
-
08-12-2019 - |
Pergunta
Let's say I have a library, mylibrary
, that I want to search in using the search web service. How would I do that? So far I have tried this MSSQLFT query:
SELECT Title, Description, Path, Rank
FROM SCOPE()
WHERE FREETEXT(defaultproperties, 'test')
AND "PATH" LIKE '%mylibrary%'
AND "SCOPE" = 'All Sites'
ORDER BY Rank DESC
If I run this query, I get no results. If I remove the PATH
condition I get a result with a path like:
http://sharepoint/mylibrary/test.docx
This makes no sense to me. Is there something I'm doing wrong, or is it just not supposed to work this way? How should I do this?
Solução
If you're using SharePoint 2010 then you shouldn't use the SQL syntax the keyword syntax is simple just use
site:mylibrary test
Licenciado em: CC-BY-SA com atribuição
Não afiliado a sharepoint.stackexchange