I’m glad to announce the availability of ShareCoffee.Search v0.0.1 ! (github)
Today I’ve published the first Add-On for ShareCoffee. By using ShareCoffee.Search (wich is also available on NuGet, bower.io and github) you can now easily execute Search queries from any kind of SharePoint App.
ShareCoffee.Search offers full configured PropertyObjects in order to support you by writing any kind of search query. Of course can you just use ShareCoffee to execute a GET or POST request against SharePoint’s Search API but then you’ve to remember all of the property names, which turned out to be very time consuming.
Therefor I decided to publish this Add-On.
After installing the package by using NuGet for example
Both ShareCoffee and ShareCoffee.Search will be pulled form the NuGet Repository and installed to your App Project. Next is referencing the files using
Executing a Query (GET)
Creating a Query using ShareCoffee.Search is nothing special. Depending on your environment you either enter by ShareCoffee.REST or ShareCoffee.CrossDomain namespace and use the typical ShareCoffee API. If you’re executing queries using HTTP GET there is a URL length limitation which is defined in RFC 2616 caused by this ShareCoffee will throw an error if you try to execute a GET request using such a long URL. Instead you should use PostQuery (see next paragraph)
Executing a PostQuery (POST)
I’ve written an article earlier today about some wired errors when executing PostQueries using SharePoint’s REST interface. (read article). Because of these problems, there is a dedicated ShareCoffee.PostQueryProperties class which has to be used to execute PostQueries. See the following sample which executes a PostQuery from an CloudHosted App using SP.RequestExecutor
Executing a SuggestQuery (GET)
Last but not least there is also support for suggest queries. Suggest queries are straight forward. Just set all the properties you’re interested in on a new instance of ShareCoffee.SuggestProperties and execute the query as expected.
Feedback wanted :)
It would be great to get some feedback from the community on ShareCoffee and ShareCoffee.Search. Do you have any issues when using my library? Is there something you don’t like about it? Do you like it? Anyways just add a comment here or create an issue on github describing your problem!