Skip to content

Instantly share code, notes, and snippets.

static async void SearchTest()
{
var credentials = new SearchCredentials("myaccountkey");
var indexClient = new SearchIndexClient("mysearchservicename", "myindexname", credentials);
var searchResults = await indexClient.Documents.SearchAsync("filename:'건국화원'");
Console.WriteLine(searchResults.Results.Count);//Prints 1
}
using System;
using Microsoft.Azure.Documents;
using System.Threading.Tasks;
using Microsoft.Azure.Documents.Client;
namespace StackOverflow.NetCore
{
class Program
{
private static IDocumentClient client = new Microsoft.Azure.Documents.Client.DocumentClient(new Uri("https://myaccount.documents.azure.com"), "accountkey==");
const fs = require('fs');
const Promise = require('bluebird');
const createEmptyFileOfSize = (fileName, size) => {
return new Promise((resolve, reject) => {
try {
fd = fs.openSync(fileName, 'w');
fs.writeSync(fd, Buffer.alloc(1), 0, 1, Math.max(0, size-1));
fs.closeSync(fd);
resolve(true);
Select Users.Id,
Users.DisplayName,
Min(Posts.CreationDate) as FirstAnswerProvidedDate,
Max(Posts.CreationDate) as LastAnswerProvidedDate,
Count(Distinct(Posts.Id)) As AnswersProvided,
SUM(CASE WHEN Votes.VoteTypeId = 1 THEN 1 ELSE 0 END) AS AcceptedAnswers,
SUM(CASE WHEN Votes.VoteTypeId = 2 THEN 1 ELSE 0 END) AS UpVotes,
SUM(CASE WHEN Votes.VoteTypeId = 3 THEN 1 ELSE 0 END) AS Downvotes
From Users
Left Join Posts on Users.Id = Posts.OwnerUserId