Skip to content

Commit

Permalink
upgraded structuremap to the latest version
Browse files Browse the repository at this point in the history
fixed broken injections
ilmerge not fixed.... I dont care
  • Loading branch information
unknown authored and unknown committed Jan 7, 2015
1 parent 6100e27 commit 95191c3
Show file tree
Hide file tree
Showing 18 changed files with 1,102 additions and 1,011 deletions.
4 changes: 2 additions & 2 deletions Castle.Facilities.SolrNetIntegration/packages.config
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Castle.Core" version="3.2.0" targetFramework="net35" />
<package id="Castle.Windsor" version="3.2.0" targetFramework="net35" />
<package id="Castle.Core" version="3.2.0" targetFramework="net35" requireReinstallation="True" />
<package id="Castle.Windsor" version="3.2.0" targetFramework="net35" requireReinstallation="True" />
</packages>
428 changes: 214 additions & 214 deletions SolrNet/ISolrOperations.cs

Large diffs are not rendered by default.

56 changes: 28 additions & 28 deletions SolrNet/ISolrQueryExecuter.cs
Original file line number Diff line number Diff line change
@@ -1,35 +1,35 @@
#region license
// Copyright (c) 2007-2010 Mauricio Scheffer
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#endregion

using System.Collections.Generic;
#region license
// Copyright (c) 2007-2010 Mauricio Scheffer
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#endregion

using System.Collections.Generic;
using SolrNet.Commands.Parameters;
using SolrNet.Impl;

namespace SolrNet {
/// <summary>
/// Executable query
/// </summary>
/// <typeparam name="T">Document type</typeparam>
public interface ISolrQueryExecuter<T> {
/// <summary>
/// Executes the query and returns results
/// </summary>
/// <returns>query results</returns>
namespace SolrNet {
/// <summary>
/// Executable query
/// </summary>
/// <typeparam name="T">Document type</typeparam>
public interface ISolrQueryExecuter<T> {
/// <summary>
/// Executes the query and returns results
/// </summary>
/// <returns>query results</returns>
SolrQueryResults<T> Execute(ISolrQuery q, QueryOptions options);

SolrMoreLikeThisHandlerResults<T> Execute(SolrMLTQuery query, MoreLikeThisHandlerQueryOptions options);
}
}
}
252 changes: 126 additions & 126 deletions SolrNet/Impl/SolrBasicServer.cs
Original file line number Diff line number Diff line change
@@ -1,138 +1,138 @@
#region license
// Copyright (c) 2007-2010 Mauricio Scheffer
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#endregion

using System;
using System.Collections.Generic;
using System.Xml.Linq;
using SolrNet.Commands;
using SolrNet.Commands.Parameters;
using SolrNet.Schema;

namespace SolrNet.Impl {
/// <summary>
/// Implements the basic Solr operations
/// </summary>
/// <typeparam name="T">Document type</typeparam>
public class SolrBasicServer<T> : ISolrBasicOperations<T> {
private readonly ISolrConnection connection;
private readonly ISolrQueryExecuter<T> queryExecuter;
private readonly ISolrDocumentSerializer<T> documentSerializer;
private readonly ISolrSchemaParser schemaParser;
private readonly ISolrHeaderResponseParser headerParser;
private readonly ISolrQuerySerializer querySerializer;
private readonly ISolrDIHStatusParser dihStatusParser;
private readonly ISolrExtractResponseParser extractResponseParser;

public SolrBasicServer(ISolrConnection connection, ISolrQueryExecuter<T> queryExecuter, ISolrDocumentSerializer<T> documentSerializer, ISolrSchemaParser schemaParser, ISolrHeaderResponseParser headerParser, ISolrQuerySerializer querySerializer, ISolrDIHStatusParser dihStatusParser, ISolrExtractResponseParser extractResponseParser) {
this.connection = connection;
this.extractResponseParser = extractResponseParser;
this.queryExecuter = queryExecuter;
this.documentSerializer = documentSerializer;
this.schemaParser = schemaParser;
this.headerParser = headerParser;
this.querySerializer = querySerializer;
this.dihStatusParser = dihStatusParser;
}

public ResponseHeader Commit(CommitOptions options) {
options = options ?? new CommitOptions();
var cmd = new CommitCommand {
WaitFlush = options.WaitFlush,
WaitSearcher = options.WaitSearcher,
ExpungeDeletes = options.ExpungeDeletes,
MaxSegments = options.MaxSegments,
};
return SendAndParseHeader(cmd);
}

public ResponseHeader Optimize(CommitOptions options) {
options = options ?? new CommitOptions();
var cmd = new OptimizeCommand {
WaitFlush = options.WaitFlush,
WaitSearcher = options.WaitSearcher,
ExpungeDeletes = options.ExpungeDeletes,
MaxSegments = options.MaxSegments,
};
return SendAndParseHeader(cmd);
}

public ResponseHeader Rollback() {
return SendAndParseHeader(new RollbackCommand());
}

public ResponseHeader AddWithBoost(IEnumerable<KeyValuePair<T, double?>> docs, AddParameters parameters) {
var cmd = new AddCommand<T>(docs, documentSerializer, parameters);
return SendAndParseHeader(cmd);
}

public ExtractResponse Extract(ExtractParameters parameters) {
var cmd = new ExtractCommand(parameters);
return SendAndParseExtract(cmd);
#region license
// Copyright (c) 2007-2010 Mauricio Scheffer
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#endregion

using System;
using System.Collections.Generic;
using System.Xml.Linq;
using SolrNet.Commands;
using SolrNet.Commands.Parameters;
using SolrNet.Schema;

namespace SolrNet.Impl {
/// <summary>
/// Implements the basic Solr operations
/// </summary>
/// <typeparam name="T">Document type</typeparam>
public class SolrBasicServer<T> : ISolrBasicOperations<T> {
private readonly ISolrConnection connection;
private readonly ISolrQueryExecuter<T> queryExecuter;
private readonly ISolrDocumentSerializer<T> documentSerializer;
private readonly ISolrSchemaParser schemaParser;
private readonly ISolrHeaderResponseParser headerParser;
private readonly ISolrQuerySerializer querySerializer;
private readonly ISolrDIHStatusParser dihStatusParser;
private readonly ISolrExtractResponseParser extractResponseParser;

public SolrBasicServer(ISolrConnection connection, ISolrQueryExecuter<T> queryExecuter, ISolrDocumentSerializer<T> documentSerializer, ISolrSchemaParser schemaParser, ISolrHeaderResponseParser headerParser, ISolrQuerySerializer querySerializer, ISolrDIHStatusParser dihStatusParser, ISolrExtractResponseParser extractResponseParser) {
this.connection = connection;
this.extractResponseParser = extractResponseParser;
this.queryExecuter = queryExecuter;
this.documentSerializer = documentSerializer;
this.schemaParser = schemaParser;
this.headerParser = headerParser;
this.querySerializer = querySerializer;
this.dihStatusParser = dihStatusParser;
}

public ResponseHeader Commit(CommitOptions options) {
options = options ?? new CommitOptions();
var cmd = new CommitCommand {
WaitFlush = options.WaitFlush,
WaitSearcher = options.WaitSearcher,
ExpungeDeletes = options.ExpungeDeletes,
MaxSegments = options.MaxSegments,
};
return SendAndParseHeader(cmd);
}

public ResponseHeader Optimize(CommitOptions options) {
options = options ?? new CommitOptions();
var cmd = new OptimizeCommand {
WaitFlush = options.WaitFlush,
WaitSearcher = options.WaitSearcher,
ExpungeDeletes = options.ExpungeDeletes,
MaxSegments = options.MaxSegments,
};
return SendAndParseHeader(cmd);
}

public ResponseHeader Rollback() {
return SendAndParseHeader(new RollbackCommand());
}

public ResponseHeader AddWithBoost(IEnumerable<KeyValuePair<T, double?>> docs, AddParameters parameters) {
var cmd = new AddCommand<T>(docs, documentSerializer, parameters);
return SendAndParseHeader(cmd);
}

public ExtractResponse Extract(ExtractParameters parameters) {
var cmd = new ExtractCommand(parameters);
return SendAndParseExtract(cmd);
}

public ResponseHeader Delete(IEnumerable<string> ids, ISolrQuery q, DeleteParameters parameters)
{
var delete = new DeleteCommand(new DeleteByIdAndOrQueryParam(ids, q, querySerializer), parameters);
return SendAndParseHeader(delete);
}

public ResponseHeader Delete(IEnumerable<string> ids, ISolrQuery q) {
var delete = new DeleteCommand(new DeleteByIdAndOrQueryParam(ids, q, querySerializer), null);
return SendAndParseHeader(delete);
}

public SolrQueryResults<T> Query(ISolrQuery query, QueryOptions options) {
return queryExecuter.Execute(query, options);
}

public string Send(ISolrCommand cmd) {
return cmd.Execute(connection);
}

public ExtractResponse SendAndParseExtract(ISolrCommand cmd) {
var r = Send(cmd);
var xml = XDocument.Parse(r);
return extractResponseParser.Parse(xml);
}

public ResponseHeader SendAndParseHeader(ISolrCommand cmd) {
var r = Send(cmd);
var xml = XDocument.Parse(r);
return headerParser.Parse(xml);
}

public ResponseHeader Ping() {
return SendAndParseHeader(new PingCommand());
}

public ResponseHeader Delete(IEnumerable<string> ids, ISolrQuery q) {
var delete = new DeleteCommand(new DeleteByIdAndOrQueryParam(ids, q, querySerializer), null);
return SendAndParseHeader(delete);
}

public SolrQueryResults<T> Query(ISolrQuery query, QueryOptions options) {
return queryExecuter.Execute(query, options);
}

public string Send(ISolrCommand cmd) {
return cmd.Execute(connection);
}

public ExtractResponse SendAndParseExtract(ISolrCommand cmd) {
var r = Send(cmd);
var xml = XDocument.Parse(r);
return extractResponseParser.Parse(xml);
}

public ResponseHeader SendAndParseHeader(ISolrCommand cmd) {
var r = Send(cmd);
var xml = XDocument.Parse(r);
return headerParser.Parse(xml);
}

public ResponseHeader Ping() {
return SendAndParseHeader(new PingCommand());
}

public SolrSchema GetSchema(string schemaFileName) {
string schemaXml = connection.Get("/admin/file", new[] { new KeyValuePair<string, string>("file", schemaFileName) });
var schema = XDocument.Parse(schemaXml);
return schemaParser.Parse(schema);
}

public SolrDIHStatus GetDIHStatus(KeyValuePair<string, string> options) {
var response = connection.Get("/dataimport", null);
var dihstatus = XDocument.Parse(response);
return dihStatusParser.Parse(dihstatus);
string schemaXml = connection.Get("/admin/file", new[] { new KeyValuePair<string, string>("file", schemaFileName) });
var schema = XDocument.Parse(schemaXml);
return schemaParser.Parse(schema);
}

public SolrDIHStatus GetDIHStatus(KeyValuePair<string, string> options) {
var response = connection.Get("/dataimport", null);
var dihstatus = XDocument.Parse(response);
return dihStatusParser.Parse(dihstatus);
}

public SolrMoreLikeThisHandlerResults<T> MoreLikeThis(SolrMLTQuery query, MoreLikeThisHandlerQueryOptions options)
{
return this.queryExecuter.Execute(query, options);
}
}
}
{
return this.queryExecuter.Execute(query, options);
}
}
}
Loading

0 comments on commit 95191c3

Please sign in to comment.