Lucid Imagination

Secondary links

  • Contact Us
  • Sign Up or Login
  • Downloads
  • Solutions
    • Partners |
    • Blog |
    • Software |
    • Services |
    • Training |
    • Case Studies |
    • Webinars |
  • Developers
    • Blog |
    • Tech Articles |
    • Community |
    • Docs |
    • Downloads |
    • Whitepapers |
    • Podcasts |
  • About
    • Market Overview |
    • Management |
    • Company News |
    • In the Media |
    • Contact |

beta

Start new search

Back to search results

  1. FromDate
  2. Ranveer Kumar1969-12-31 19:00
  3. Ranveer Kumar1969-12-31 19:00
  4. Sven Maurmann1969-12-31 19:00
  5. Sven Maurmann1969-12-31 19:00

[solr-user] Embedded Solr problem

Subject:
Re: Embedded Solr problem
From:
Sven Maurmann <sven.maurmann@...>
Date:
1969-12-31 19:00
Hi Ranveer,

I assume that you have enough knowlesge in Java. You should essentially
your code for instantiating the server (depending on what you intend to
do this may be done in a separate class or in a method of the class doing
the queries). Then you use this instance to handle all the queries using
for example the method "query" of SolrServer.

For further information you may want to consult either the API documentation
or the url http://wiki.apache.org/solr/Solrj from the wiki.

Cheers,
    Sven

--On Montag, 8. Februar 2010 08:53 +0530 Ranveer Kumar 
<ranveer.solr@gmail.com> wrote:

Hi Sven, thanks for reply. yes i notice that every time when request, new instance is created of solr server. could you please guide me to do the same ( initialization to create an instance of SolrServer, once during first request). On Mon, Feb 8, 2010 at 2:11 AM, Sven Maurmann <sven.maurmann@kippdata.de>wrote:
Hi, would it be possible that you instantiate a new instance of your SolrServer every time you do a query? You should use the code you quoted in your mail once during initialization to create an instance of SolrServer (the interface being implemented by EmbeddedSolrServer) and subsquently use the query method of SolrServer to do the query. Cheers, Sven --On Sonntag, 7. Februar 2010 21:54 +0530 Ranveer Kumar < ranveer.solr@gmail.com> wrote: Hi All,
I am still very new to solr. Currently I am facing problem to use EmbeddedSolrServer. following is my code: File home = new File("D:/ranveer/java/solr_home/solr/first"); CoreContainer coreContainer = new CoreContainer(); SolrConfig config = null; config = new SolrConfig(home + "/core1","solrconfig.xml",null); CoreDescriptor descriptor = new CoreDescriptor(coreContainer,"core1",home + "/core1"); SolrCore core = new SolrCore("core1", home+"/core1/data", config, new IndexSchema(config, "schema.xml",null), descriptor); coreContainer.register(core.getName(), core, true); final EmbeddedSolrServer server = new EmbeddedSolrServer(coreContainer, "core1"); Now my problem is every time when I making request for search SolrCore is initializing the core. I want if the core/instance of core is already start then just use previously started core. Due to this problem right now searching is taking too much time. I tried to close core after search but same thing when fresh search result is made, solr is starting from very basic. please help.. thanks

Solr Powered

Give us your feedback

  • Lucene
  • Solr
  • Nutch
  • Tika
  • Mahout
  • Droids
  • PyLucene
  • Lucene.Net
  • Lucy
  • Lucene4c
  • Open Relevance Project
  • How We Can Help:
    • Getting Started |
    • Support Subscriptions |
    • White Papers |
    • Training |
    • Consulting |
    • Contact Us |
  • Developers:
    • Blog |
    • Documentation |
    • Tech Articles |
    • Podcasts and Videos |
    • Community |
  • Downloads:
    • LucidWorks for Solr |
    • LucidWorks for Lucene |
    • LucidGaze for Solr |
    • LucidGaze for Lucene |
  • Products:
  • Services:

Contact | Privacy Policy | Legal Terms of Use | Copyrights and Disclaimers | Admin

Apache Solr, Apache Lucene, ApacheCon and their logos are trademarks of the Apache Software Foundation.

© 2010 Lucid Imagination. All Right reserved.