This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public string AutoSuggest(string query) | |
{ | |
const int maxResults = 10; | |
const int startpage = 1; | |
var solr = ServiceLocator.Current.GetInstance<ISolrOperations<Item>>(); | |
var options = new QueryOptions | |
{ | |
Rows = maxResults, | |
Start = (startpage - 1)*maxResults |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
http://localhost:8983/solr/collection1/update?stream.body=<delete><query>*:*</query></delete> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script> | |
<script> | |
var personNameVar = "Paul"; | |
var dataIn = '{' + '"personName":"' + personNameVar + '"}'; | |
$.ajax({ | |
url: "/Service1.svc/HelloWorld", | |
type: "POST", | |
contentType: "application/json; charset=utf-8", | |
data: dataIn, | |
dataType: "json", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class HelloWorldWrapper | |
{ | |
public string Response; | |
public string TimeExecuted; | |
public string Error; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[OperationContract] | |
public string HelloWorld(string personName) | |
{ | |
return (new HelloWorldWrapper | |
{ | |
Response = string.Format("Hello, {0}", personName), | |
Error = "", | |
TimeExecuted = DateTime.Now.ToString(CultureInfo.InvariantCulture) | |
}).ToJson(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class JsonHelper | |
{ | |
public static string ToJson(this object obj) | |
{ | |
var serializer = new JavaScriptSerializer(); | |
return serializer.Serialize(obj); | |
} | |
public static string ToJson(this object obj, int recursionDepth) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<user name="myUsername" password="myPassword" roles="admin-gui,manager-gui,solr_admin"></user> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<web-resource-collection> | |
<web-resource-name>Solr Lockdown</web-resource-name> | |
<url-pattern>/</url-pattern> | |
</web-resource-collection> | |
<auth-constraint> | |
<role-name>solr_admin</role-name> | |
<role-name>admin</role-name> | |
</auth-constraint> | |
</security-constraint> | |
<login-config> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<web-app xmlns="http://java.sun.com/xml/ns/javaee" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" | |
version="2.5" | |
metadata-complete="true" | |
> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Ignore Visual Studio temporary files, build results, and | |
## files generated by popular Visual Studio add-ons. | |
# User-specific files | |
*.suo | |
*.user | |
*.sln.docstates | |
# Build results |