Access Office365/SharePoint Online search web service unsing ADALiOS - ios

I'm try to access the Office365 (SharePoint) search service of my tenant, e.g.:
https://myTenant.sharepoint.com/_vti_bin/search.asmx
from iOS using the ADALiOS library (https://github.com/AzureADSamples/NativeClient-iOS).
The samples all seem quite complex, setting up another application, integrating Web API, etc.
In the end, I think I just have to authenticate once, get the token and send it which each request.
Is there any sample available that shows how to do this (seemingly) simple task?
Or has anybody done this before, maybe even without ADALiOS?
Any hint is appreciated!
Eau

I use REST web service for the purpose.
The official guide is too obscure. Below you can find samples that cover simple and advanced queries. They will make things clear:
full-text and property "title"
_https://MYTENANT.sharepoint.com/_api/search/query?QueryText='part title:document'&selectproperties='Title,Author,Size,Path,Description,Write,LastModifiedTime,HitHighlightedSummary,ServerRedirectedPreviewURL,FileExtension,UniqueId,DisplayAuthor,UrlZone,Culture'&rowlimit=20&rowsperpage=20
full-text and property "author" and "title"
_https://MYTENANT.sharepoint.com/_api/search/query?QueryText='part title:document author:kapil'&selectproperties='Title,Author,Size,Path,Description,Write,LastModifiedTime,HitHighlightedSummary,ServerRedirectedPreviewURL,FileExtension,UniqueId,DisplayAuthor,UrlZone,Culture'&rowlimit=20&rowsperpage=20
full-text and size limitation
_https://MYTENANT.sharepoint.com/_api/search/query?QueryText='part title:document size>60000'&selectproperties='Title,Author,Size,Path,Description,Write,LastModifiedTime,HitHighlightedSummary,ServerRedirectedPreviewURL,FileExtension,UniqueId,DisplayAuthor,UrlZone,Culture'&rowlimit=20&rowsperpage=20
full-text and last modified time
_https://MYTENANT.sharepoint.com/_api/search/query?QueryText='part title:document LastModifiedTime>2014-08-04T04:09:00.0000000Z'&selectproperties='Title,Author,Size,Path,Description,Write,LastModifiedTime,HitHighlightedSummary,ServerRedirectedPreviewURL,FileExtension,UniqueId,DisplayAuthor,UrlZone,Culture'&rowlimit=20&rowsperpage=20
full-text and last modified date
_https://MYTENANT.sharepoint.com/_api/search/query?QueryText='part title:document LastModifiedTime>2014-08-04'&selectproperties='Title,Author,Size,Path,Description,Write,LastModifiedTime,HitHighlightedSummary,ServerRedirectedPreviewURL,FileExtension,UniqueId,DisplayAuthor,UrlZone,Culture'&rowlimit=20&rowsperpage=20

Related

Code to check whether site has been listed on search engines and directories

I am currently developing an application in Rails, which requires to check whether a website has been listed in Google, Bing, Yahoo, Yelp and Yellow Pages. From my research the best is to check site: domain.com on Google and Bing and look for results and check in Yahoo directory for the domain.
Is there any other way to do it? I mean some code snippet to check on domain's home page or using their API or something like that. Also how to check on Yelp and Yellow pages.
You can use mechanize and write web-style drivers
Google: do a search on your domain with this on the search term
site:checkmeout360.com
https://www.google.com/search?q=site%3A<SITE_NAME>.com
Try to see how yelp, yahoo, bing and yellow pages do indexing. Then you can use mechanize to automate the searching process for you, you can use mechanize to do the search like above with google, then write asserts (check if stuff you are looking for is on the search result)
Search engines don't appreciate automated queries that are sent their way.
Here is what Google has to say about it:
Google's Terms of Service do not allow the sending of automated queries of any sort to our system without express permission in advance from Google. Sending automated queries consumes resources and includes using any software (such as WebPosition Gold) to send automated queries to Google to determine how a website or webpage ranks in Google search results for various queries. In addition to rank checking, other types of automated access to Google without permission are also a violation of our Webmaster Guidelines and Terms of Service.

How best to aggregate site statistics (especially search demand)

I am working on a rails application that uses sunspot solr for search. I have been asked to log (or capture in some way) each search that happens on the site; the query, the user that did the search, the result count that resulted from their search...etc, so that the company can report on what people are searching on (demand), and other things.
Before I go and make a table, that will receive an ever-growing number of rows of search data, I'm wondering if anyone has done this in a better way? Can I use analytics (google?) in some way for this? Is there some kind of service I can send this information too, such that we could easily pull reports, or create reports from?
In short, is there some better/smarter way than creating my own table and storing this all in our own DB?
I had never done this, but here are some thoughts.
If you just need to store that data I think you should do it yourself.
If you need to also provide a way to analyse the data yes, see if there is anything already done (I'm not sure but it seems google analytics only support internal search using their search bar).
If your client already have some BI tool they just need a way to access the data, and it would be easier to have it in a owned DB wich you can easily be query instead of using a provider api.

Is there a web search service/site either with an API or which works with YQL?

I'd like to make a tool which accesses a search engine programatically.
I've been enjoying using YQL recently and thought it might be useful since it can dig data out of HTML pages.
But I tried it with Google, Bing, and Yahoo search and they all seem to block YQL.
I wonder if there are some lesser-known web search sites that might work with YQL.
Or actually if there's still any search engine which offers an API that would be even better.
(In fact I'm only searching linguistics.stackexchange.com because the Stack Exchange APIs don't provide a way to search by text that I can find.)
Most search engine sites will block access from screen scrapers and other agents. YQL is designed to respect the robots.txt file, so on many sites like this it won't work.
Instead, I suggest moving a step above HTML screen scraping and using a published search API.
In YQL for example, there is a table which provides access to the Bing search results:
select * from microsoft.bing where query="soccer" and source in ("web","image")
You could also look at the Yahoo! BOSS API or using the Bing Search API directly.

Track multiple search terms with twitter streaming

I would like to build a web application that tracks some user defined search terms in real-time and provides a real-time visualization. http://www.monitter.com/ is an app I've found that is similar in its requirements. What is the appropriate API to use for it? Initially I thought the streaming API was the obvious choice, but the limitation of one concurrent connection means that I can only track one search term at a time(with one user account). I could get around this by making multiple user accounts, but that seems like the wrong approach.
I looked at user streams but the language for that API seems to be more geared towards desktop applications.
So, what is the most best API for my use case? Thanks.
Actually you can track up to 400 keywords/terms via one streaming API connection.
https://dev.twitter.com/docs/streaming-api/methods#track
Depending on language you are using there are multiple interfaces you can use.
If you are using PHP, then I can suggest Phirehose as it works quite well and has multiple examples for different usages scenarios included.
http://code.google.com/p/phirehose/wiki/Introduction
Whats not there - when processing received tweets you will need to figure out how to match which tweet corresponds to which keyword/term because twitter streaming API gives all matching tweets in one stream.
Investigating further using Firebug, I found that monitter.com simply polls the REST search api every second or so on the client side. This is what I ended up doing as well.

Fuzzy match in sharepoint search engine?

In sharepoint 2007 sites, we can search for people or other contents. Is the search engine able to do fuzzy match so that "Micheal" can be corrected to "Michael"? If it's possible, does it need extra configuration?
I am also writing a custom webpart that uses sharepoint search service, a web service that has url like "http://site/_vti_bin/search.asm". Is it possible to use this service to do fuzzy search as well?
Thanks.
The Search Summary Web Part provides that capability: try searching SharePoint for "Microsfot" and you'll get a "Did you mean Microsoft?" prompt. However, I only seem to see it when I get no results at all, and it looks like it has some other limitations:
Threewill Wiki (posted by Kirk Liemohn)
I haven't seen that kind of matching used specifically, but you might get some ideas from the wildcard search web part on codeplex.

Resources