- Make sure Java is installed on the machine.
- Install Apache Tomcat on port 8983 (or any other port) (Installed at location: D:\Apache)
- Open URL: http://localhost:8983 to check if installation is working
- Download any version of SOLR (in my case it 3.6.2 file apache-solr-3.6.2.zip)
- Stop Tomcat
- Unzip the SOLR and goto apache-solr-3.6.2\dist
- Copy the war file (apache-solr-3.6.2.war) to D:\Apache\webapps twice
- Rename the war files to solr.war and solr-preview.war respectively
- Create a SOLR home folder (in my case at location D:\Apache\solr and D:\Apache\solr-preview)
- Started and stopped Tomcat.
- Goto D:\Apache\webapps\solr\META-INF
- Create a context.xml file with content:
<Context docBase="D:\Apache\webapps\solr.war" debug="0" crossContext="true"> <Environment name="solr/home" type="java.lang.String" value="D:\Apache\solr" override="true" /> </Context> - Goto D:\Apache\webapps\solr-preview\META-INF
- Create a context.xml file with content:
<Context docBase="D:\Apache\webapps\solr-preview.war" debug="0" crossContext="true"> <Environment name="solr/home" type="java.lang.String" value="D:\Apache\solr-preview" override="true" /> </Context> - Copy all files from apache-solr-3.6.2\example\solr to both SOLR home folders D:\Apache\solr and D:\Apache\solr-preview)
- Start Tomcat Service
- The solr instances will be available on the URL: http://localhost:8983/solr and http://localhost:8983/solr-preview
- To test the settings create a SOLR node in any of the SOLR instances. E.g. in Solr-preview. The new instance will be available only on Solr-preview instance
Oct 9, 2014
Installing multiple SOLR Instances in Tomcat on Same Server
Sep 29, 2014
Oct 30, 2013
Adding Custom Configuration Section in Web.config
Recently I faced an issue where i had to read multiple key information for same settings from Web.config (as shown below):
<seacrhConfiguration>
<add verticalName="Search1" verticalShard="server:9998" />
<add verticalName="Search2" verticalShard="server:9999" />
</seacrhConfiguration>
You will need to three classes inheriting from System.Configuration namespace: ConfigurationSection, ConfigurationElementCollection, and ConfigurationElement as shown below:
using System;
using System.Collections.Generic;
using System.Configuration;
public class SearchConfigSection : ConfigurationSection
{
[ConfigurationProperty("", IsRequired = true, IsDefaultCollection = true)]
public SearchConfigCollection Instances
{
get { return (SearchConfigCollection)this[""]; }
set { this[""] = value; }
}
}
public class SearchConfigCollection : ConfigurationElementCollection
{
protected override ConfigurationElement CreateNewElement()
{
return new SearchConfigInstanceElement();
}
protected override object GetElementKey(ConfigurationElement element)
{
return ((SearchConfigInstanceElement)element).VerticalName;
}
}
public class SearchConfigInstanceElement : ConfigurationElement
{
[ConfigurationProperty("verticalName", IsKey = true, IsRequired = true)]
public string VerticalName
{
get { return (string)base["verticalName"]; }
set { base["verticalName"] = value; }
}
[ConfigurationProperty("verticalShard", IsRequired = true)]
public string VerticalShard
{
get { return (string)base["verticalShard"]; }
set { base["verticalShard"] = value; }
}
}
Now modify the web.config to include the new configurations:
<configSections>
<section name="seacrhConfiguration" type="<AssemblyName+Namespace>.SearchConfigSection, <AssemblyName>" />
</configSections><seacrhConfiguration>
<add verticalName="Search1" verticalShard="server:9998" />
<add verticalName="Search2" verticalShard="server:9999" />
</seacrhConfiguration>
Read the configuration settings on page like:
string states = string.Empty;
SearchConfigSection sec = (SearchConfigSection)System.Configuration.ConfigurationManager.GetSection("seacrhConfiguration");
foreach (SearchConfigInstanceElement i in sec.Instances)
{
states += string.Format("Name:{0} connectionName:{1}" + System.Environment.NewLine, i.VerticalName, i.VerticalShard);
}
Dec 17, 2012
How to make VMWare stop syncing your guest clock with your host
If you want the time in your vmware OS to persist through suspend, resume, reboot, etc. add these properties to your .vmx file:
This will pretty much prevent your VM from ever syncing its clock with your host.
Reference: http://blog.thetoast.net/2009/03/make-vmware-stop-syncing-your-guest.html
tools.syncTime = FALSE
time.synchronize.continue = FALSE
time.synchronize.restore = FALSE
time.synchronize.resume.disk = FALSE
time.synchronize.shrink = FALSE
time.synchronize.tools.startup = FALSE
This will pretty much prevent your VM from ever syncing its clock with your host.
Reference: http://blog.thetoast.net/2009/03/make-vmware-stop-syncing-your-guest.html
Feb 2, 2012
Setting up Subversion on Windows through SVN protocol
This document explains how to setup Subversion on Windows through SVN protocol (svn:///)
(Click the link below)
Setting up Subversion on Windows
--
(Click the link below)
Setting up Subversion on Windows
--
Nov 14, 2011
Call a client side javascript method after a specific update panel has been loaded
<script type="text/javascript">
$(document).ready(function() {
panelsLoaded = 1;
Sys.WebForms.PageRequestManager.getInstance().add_pageLoaded(PageLoaded) });
function PageLoaded(sender, args) {
console.log("I have occured " + panelsLoaded++ + " times!");
var panelsCreated = args.get_panelsCreated();
for (var i = 0; i < panelsCreated.length; i++)
{
console.log("Panels Updating: " + panelsCreated[i].id);
}
var panelsUpdated = args.get_panelsUpdated();
for (var i = 0; i < panelsUpdated.length; i++)
{
console.log("Panels Updating: " + panelsUpdated[i].id);
}
}
</script>
Just add all the scripts in the PageLoaded() function.
Nov 2, 2011
Watch hulu outside US
http://lifehacker.com/5583515/access-hulu-from-outside-the-us-without-a-proxy-server
Subscribe to:
Posts (Atom)