Esempio n. 1
0
        async Task <ILuceneQueryResult> QueryLuceneInternal(LuceneQuery query)
        {
            var response = await StartQuery(uriConstructor.GetQueryUri(query));

            if (!response.IsSuccessStatusCode)
            {
                var error = new CouchError(parent.Settings.Serializer, response);
                error.ThrowDatabaseMissingExceptionIfNedded(uriConstructor);
                error.ThrowLuceneIndexNotFoundExceptionIfNedded(query);
                error.ThrowCouchCommunicationException();
            }
            using (var reader = await response.Content.ReadAsUtf8TextReaderAsync())
                return(LuceneQueryResultParser.Parse(reader, query));
        }
Esempio n. 2
0
		async Task<ILuceneQueryResult> QueryLuceneInternal(LuceneQuery query)
		{
			var response = await StartQuery(uriConstructor.GetQueryUri(query));
			if (!response.IsSuccessStatusCode)
			{
				var error = new CouchError(parent.Settings.Serializer, response);
				error.ThrowDatabaseMissingExceptionIfNedded(uriConstructor);
				error.ThrowLuceneIndexNotFoundExceptionIfNedded(query);
				error.ThrowCouchCommunicationException();
			}
			using (var reader = await response.Content.ReadAsUtf8TextReaderAsync())
				return LuceneQueryResultParser.Parse(reader, query);
		}