3

I have to work with Solr, which I'll use from another webapp to index and search documents.
I thought I could run an instance of it inside Eclipse, alongside my web application, but if I import the Solr war, Eclipse will unpack it in a web project.
Is there a way to keep it as a War and just have it deployer inside a Tomcat server instance (in the IDE)?

Or is there a better (easier) way to do what I want to do? Basically I want a running instance of Solr to which I can connect and operate from the web application I'm developing.

Shishir Kumar
  • 7,981
  • 3
  • 29
  • 45
watery
  • 5,026
  • 9
  • 52
  • 92

1 Answers1

3

We are keeping our Solr configurations together with the according war file within an Eclipse project. I will refer to this project as your project here. That way we keep everything together in one place

  • the war file
  • the index
  • the configurations

What you need to do is

1) Create an empty tomcat server within eclipse

2) Add -Dsolr.solr.home=${resource_loc:/<your project here>/solr/home} to the VM arguments of that tomcat

enter image description here

3) Add the solr war file as <Context> to the server.xml of that tomcat enter image description here

cheffe
  • 9,345
  • 2
  • 46
  • 57
  • Uuuh... really precious, thank you! I didn't get completely how it works, but it's working, and that's what matters to me now. – watery Mar 14 '14 at 09:58