I am attempting to search a SharePoint instance using the search api. I have two files in a document library called AddDoc.docx
and AddPic.png
.
However, when I search using Add*
only AddDoc.docx
is returned in the results.
The URL for search I am using is:
http://myserver/sites/mysite/_api/search/query?querytext='(Filename:Add*)'
The requirement is to only search on the name of the file, not title or content etc.
I did find and follow this regarding adding managed file types to the search index. I have added png and forced a full crawl on the content source as described in the link. I even waited 24 hours and still no png returned. The content source is set for continuous crawl.
I have tried Filename:*
and the png is not returned. I have also tried the following URL to rule out the Filename filter, but again only the docx is returned:
http://myserver/sites/mysite/_api/search/query?querytext='(path:"http://myserver/sites/mysite/myLib/")'
Finally I tried the following in case there was and issue with png and querytext but still no png returned:
http://myserver/sites/mysite/_api/search/query?querytemplate='Filename:add*'
When I perform the same search through the SharePoint website search box with Add*
, both files are returned.
Am I missing some configuration somewhere?
Edit the call is being made from a separate website that exists on the same domain as the SharePoint server.