Re: 2 index within the same Solr server ?
I want 2 index in same solr server. How to create 2 index and its schema for two different search result On Wed, Mar 30, 2011 at 7:07 PM, Amel Fraisse amel.frai...@gmail.comwrote: Hello every body, referring to the link : http://wiki.apache.org/solr/CoreAdmin. I've created a solr.xml file as follows: solr persistent=true sharedLib=lib property name=snapshooter value=/home/solr-user/solr/ bin/snapshooter.sh / cores adminPath=/admin/cores shareSchema=false adminHandler=fr.splayce.solr.handler.MyAdminHandler core name=core1 instanceDir=core0 property name=dataDir value=/core0/data / /core core name=core2 instanceDir=core1/ property name=dataDir value=/core1/data / /cores /solr So before using SolrCore I instanciated a SolrServer to index and search documents as follows: System.setProperty(solr.solr.home, solr); CoreContainer.Initializer initializer = new CoreContainer.Initializer(); CoreContainer coreContainer = initializer.initialize(); server = new EmbeddedSolrServer(coreContainer, ); And then to index a document : server.add(doc) and to search : server.query(...). So with SolrCore I've create MyAdminHandler by overrinding handleCistomAction method like this (as mentionned in the link): protected boolean handleCustomAction(SolrQueryRequest req, SolrQueryResponse rsp) { CoreContainer container = super.getCoreContainer(); SolrCore mycore1 = container.getCore(core1); SolrCore mycore2 = container.getCore(core2); So how I could index and search document within the 2 indexes? Thank you for your help. 2011/3/29 Rahul Warawdekar rahul.warawde...@gmail.com Please refer http://wiki.apache.org/solr/MultipleIndexes On 3/29/11, Amel Fraisse amel.frai...@gmail.com wrote: Hello every body, Is it possible to create 2 index within the same Solr server ? Thank you. Amel. -- Thanks and Regards Rahul A. Warawdekar
Re: 2 index within the same Solr server ?
Hi, You have to use SolrCore to create a solr.xml file in wich you specify 2 cores ( refer to the link : http://wiki.apache.org/solr/CoreAdmin ) But for indexing and searching I've the same question: I don't know how I could specify that document would be indexed a twice (in the first index and in the second index). Amel. 2011/3/31 Deepak Singh deep...@praumtech.com I want 2 index in same solr server. How to create 2 index and its schema for two different search result On Wed, Mar 30, 2011 at 7:07 PM, Amel Fraisse amel.frai...@gmail.comwrote: Hello every body, referring to the link : http://wiki.apache.org/solr/CoreAdmin. I've created a solr.xml file as follows: solr persistent=true sharedLib=lib property name=snapshooter value=/home/solr-user/solr/ bin/snapshooter.sh / cores adminPath=/admin/cores shareSchema=false adminHandler=fr.splayce.solr.handler.MyAdminHandler core name=core1 instanceDir=core0 property name=dataDir value=/core0/data / /core core name=core2 instanceDir=core1/ property name=dataDir value=/core1/data / /cores /solr So before using SolrCore I instanciated a SolrServer to index and search documents as follows: System.setProperty(solr.solr.home, solr); CoreContainer.Initializer initializer = new CoreContainer.Initializer(); CoreContainer coreContainer = initializer.initialize(); server = new EmbeddedSolrServer(coreContainer, ); And then to index a document : server.add(doc) and to search : server.query(...). So with SolrCore I've create MyAdminHandler by overrinding handleCistomAction method like this (as mentionned in the link): protected boolean handleCustomAction(SolrQueryRequest req, SolrQueryResponse rsp) { CoreContainer container = super.getCoreContainer(); SolrCore mycore1 = container.getCore(core1); SolrCore mycore2 = container.getCore(core2); So how I could index and search document within the 2 indexes? Thank you for your help. 2011/3/29 Rahul Warawdekar rahul.warawde...@gmail.com Please refer http://wiki.apache.org/solr/MultipleIndexes On 3/29/11, Amel Fraisse amel.frai...@gmail.com wrote: Hello every body, Is it possible to create 2 index within the same Solr server ? Thank you. Amel. -- Thanks and Regards Rahul A. Warawdekar
Re: 2 index within the same Solr server ?
On Thursday 31 March 2011 12:58:54 Amel Fraisse wrote: But for indexing and searching I've the same question: I don't know how I could specify that document would be indexed a twice (in the first index and in the second index). Amel, if you use multi core and wish to have a document indexed in both cores then you must post the document to both cores. Amel. On Wed, Mar 30, 2011 at 7:07 PM, Amel Fraisse amel.frai...@gmail.comwrote: Hello every body, referring to the link : http://wiki.apache.org/solr/CoreAdmin. I've created a solr.xml file as follows: solr persistent=true sharedLib=lib property name=snapshooter value=/home/solr-user/solr/ bin/snapshooter.sh / cores adminPath=/admin/cores shareSchema=false adminHandler=fr.splayce.solr.handler.MyAdminHandler core name=core1 instanceDir=core0 property name=dataDir value=/core0/data / /core core name=core2 instanceDir=core1/ property name=dataDir value=/core1/data / /cores /solr So before using SolrCore I instanciated a SolrServer to index and search documents as follows: System.setProperty(solr.solr.home, solr); CoreContainer.Initializer initializer = new CoreContainer.Initializer(); CoreContainer coreContainer = initializer.initialize(); server = new EmbeddedSolrServer(coreContainer, ); And then to index a document : server.add(doc) and to search : server.query(...). So with SolrCore I've create MyAdminHandler by overrinding handleCistomAction method like this (as mentionned in the link): protected boolean handleCustomAction(SolrQueryRequest req, SolrQueryResponse rsp) { CoreContainer container = super.getCoreContainer(); SolrCore mycore1 = container.getCore(core1); SolrCore mycore2 = container.getCore(core2); So how I could index and search document within the 2 indexes? Thank you for your help. 2011/3/29 Rahul Warawdekar rahul.warawde...@gmail.com Please refer http://wiki.apache.org/solr/MultipleIndexes On 3/29/11, Amel Fraisse amel.frai...@gmail.com wrote: Hello every body, Is it possible to create 2 index within the same Solr server ? Thank you. Amel. -- Thanks and Regards Rahul A. Warawdekar -- Markus Jelsma - CTO - Openindex http://www.linkedin.com/in/markus17 050-8536620 / 06-50258350
Re: 2 index within the same Solr server ?
Hi Markus, Thank you for your response. In fact, I never used SolrCore before that. So could you give me an example to ilustrate how I could send a document to be indexed by both cores? Thank you. Amel. 2011/3/31 Markus Jelsma markus.jel...@openindex.io On Thursday 31 March 2011 12:58:54 Amel Fraisse wrote: But for indexing and searching I've the same question: I don't know how I could specify that document would be indexed a twice (in the first index and in the second index). Amel, if you use multi core and wish to have a document indexed in both cores then you must post the document to both cores. Amel. On Wed, Mar 30, 2011 at 7:07 PM, Amel Fraisse amel.frai...@gmail.comwrote: Hello every body, referring to the link : http://wiki.apache.org/solr/CoreAdmin. I've created a solr.xml file as follows: solr persistent=true sharedLib=lib property name=snapshooter value=/home/solr-user/solr/ bin/snapshooter.sh / cores adminPath=/admin/cores shareSchema=false adminHandler=fr.splayce.solr.handler.MyAdminHandler core name=core1 instanceDir=core0 property name=dataDir value=/core0/data / /core core name=core2 instanceDir=core1/ property name=dataDir value=/core1/data / /cores /solr So before using SolrCore I instanciated a SolrServer to index and search documents as follows: System.setProperty(solr.solr.home, solr); CoreContainer.Initializer initializer = new CoreContainer.Initializer(); CoreContainer coreContainer = initializer.initialize(); server = new EmbeddedSolrServer(coreContainer, ); And then to index a document : server.add(doc) and to search : server.query(...). So with SolrCore I've create MyAdminHandler by overrinding handleCistomAction method like this (as mentionned in the link): protected boolean handleCustomAction(SolrQueryRequest req, SolrQueryResponse rsp) { CoreContainer container = super.getCoreContainer(); SolrCore mycore1 = container.getCore(core1); SolrCore mycore2 = container.getCore(core2); So how I could index and search document within the 2 indexes? Thank you for your help. 2011/3/29 Rahul Warawdekar rahul.warawde...@gmail.com Please refer http://wiki.apache.org/solr/MultipleIndexes On 3/29/11, Amel Fraisse amel.frai...@gmail.com wrote: Hello every body, Is it possible to create 2 index within the same Solr server ? Thank you. Amel. -- Thanks and Regards Rahul A. Warawdekar -- Markus Jelsma - CTO - Openindex http://www.linkedin.com/in/markus17 050-8536620 / 06-50258350
Re: 2 index within the same Solr server ?
I don't use SolrJ. Try to find the documentation for that. On Thursday 31 March 2011 13:09:49 Amel Fraisse wrote: Hi Markus, Thank you for your response. In fact, I never used SolrCore before that. So could you give me an example to ilustrate how I could send a document to be indexed by both cores? Thank you. Amel. 2011/3/31 Markus Jelsma markus.jel...@openindex.io On Thursday 31 March 2011 12:58:54 Amel Fraisse wrote: But for indexing and searching I've the same question: I don't know how I could specify that document would be indexed a twice (in the first index and in the second index). Amel, if you use multi core and wish to have a document indexed in both cores then you must post the document to both cores. Amel. On Wed, Mar 30, 2011 at 7:07 PM, Amel Fraisse amel.frai...@gmail.comwrote: Hello every body, referring to the link : http://wiki.apache.org/solr/CoreAdmin. I've created a solr.xml file as follows: solr persistent=true sharedLib=lib property name=snapshooter value=/home/solr-user/solr/ bin/snapshooter.sh / cores adminPath=/admin/cores shareSchema=false adminHandler=fr.splayce.solr.handler.MyAdminHandler core name=core1 instanceDir=core0 property name=dataDir value=/core0/data / /core core name=core2 instanceDir=core1/ property name=dataDir value=/core1/data / /cores /solr So before using SolrCore I instanciated a SolrServer to index and search documents as follows: System.setProperty(solr.solr.home, solr); CoreContainer.Initializer initializer = new CoreContainer.Initializer(); CoreContainer coreContainer = initializer.initialize(); server = new EmbeddedSolrServer(coreContainer, ); And then to index a document : server.add(doc) and to search : server.query(...). So with SolrCore I've create MyAdminHandler by overrinding handleCistomAction method like this (as mentionned in the link): protected boolean handleCustomAction(SolrQueryRequest req, SolrQueryResponse rsp) { CoreContainer container = super.getCoreContainer(); SolrCore mycore1 = container.getCore(core1); SolrCore mycore2 = container.getCore(core2); So how I could index and search document within the 2 indexes? Thank you for your help. 2011/3/29 Rahul Warawdekar rahul.warawde...@gmail.com Please refer http://wiki.apache.org/solr/MultipleIndexes On 3/29/11, Amel Fraisse amel.frai...@gmail.com wrote: Hello every body, Is it possible to create 2 index within the same Solr server ? Thank you. Amel. -- Thanks and Regards Rahul A. Warawdekar -- Markus Jelsma - CTO - Openindex http://www.linkedin.com/in/markus17 050-8536620 / 06-50258350 -- Markus Jelsma - CTO - Openindex http://www.linkedin.com/in/markus17 050-8536620 / 06-50258350
Re: 2 index within the same Solr server ?
I would guess just the way you always use cores. You'd open your connection in SolrJ with the core name tacked on, something like: CommonsHttpSolrServer server1 = new CommonsHttpSolrServer(http://localhost:8983/solr/core1); CommonsHttpSolrServer server2 = new CommonsHttpSolrServer(http://localhost:8983/solr/core2); then add the document to both servers. But I confess I haven't tried it from SolrJ so it's a guess. There may be more efficient ways to do this. But I have to ask what the purpose of putting the *same* document in two cores is. Seems like a waste. That said, I don't know your problem space. Best Erick On Thu, Mar 31, 2011 at 7:09 AM, Amel Fraisse amel.frai...@gmail.com wrote: Hi Markus, Thank you for your response. In fact, I never used SolrCore before that. So could you give me an example to ilustrate how I could send a document to be indexed by both cores? Thank you. Amel. 2011/3/31 Markus Jelsma markus.jel...@openindex.io On Thursday 31 March 2011 12:58:54 Amel Fraisse wrote: But for indexing and searching I've the same question: I don't know how I could specify that document would be indexed a twice (in the first index and in the second index). Amel, if you use multi core and wish to have a document indexed in both cores then you must post the document to both cores. Amel. On Wed, Mar 30, 2011 at 7:07 PM, Amel Fraisse amel.frai...@gmail.comwrote: Hello every body, referring to the link : http://wiki.apache.org/solr/CoreAdmin. I've created a solr.xml file as follows: solr persistent=true sharedLib=lib property name=snapshooter value=/home/solr-user/solr/ bin/snapshooter.sh / cores adminPath=/admin/cores shareSchema=false adminHandler=fr.splayce.solr.handler.MyAdminHandler core name=core1 instanceDir=core0 property name=dataDir value=/core0/data / /core core name=core2 instanceDir=core1/ property name=dataDir value=/core1/data / /cores /solr So before using SolrCore I instanciated a SolrServer to index and search documents as follows: System.setProperty(solr.solr.home, solr); CoreContainer.Initializer initializer = new CoreContainer.Initializer(); CoreContainer coreContainer = initializer.initialize(); server = new EmbeddedSolrServer(coreContainer, ); And then to index a document : server.add(doc) and to search : server.query(...). So with SolrCore I've create MyAdminHandler by overrinding handleCistomAction method like this (as mentionned in the link): protected boolean handleCustomAction(SolrQueryRequest req, SolrQueryResponse rsp) { CoreContainer container = super.getCoreContainer(); SolrCore mycore1 = container.getCore(core1); SolrCore mycore2 = container.getCore(core2); So how I could index and search document within the 2 indexes? Thank you for your help. 2011/3/29 Rahul Warawdekar rahul.warawde...@gmail.com Please refer http://wiki.apache.org/solr/MultipleIndexes On 3/29/11, Amel Fraisse amel.frai...@gmail.com wrote: Hello every body, Is it possible to create 2 index within the same Solr server ? Thank you. Amel. -- Thanks and Regards Rahul A. Warawdekar -- Markus Jelsma - CTO - Openindex http://www.linkedin.com/in/markus17 050-8536620 / 06-50258350
Re: 2 index within the same Solr server ?
On 3/31/2011 5:09 AM, Amel Fraisse wrote: Hi Markus, Thank you for your response. In fact, I never used SolrCore before that. So could you give me an example to ilustrate how I could send a document to be indexed by both cores? There is no magic within Solr that would let you issue a single command and import/post documents to more than one core. The cores are not linked in any way, even if you have them share config files. You could have one core replicate to the other, but I don't see much point to doing that, unless you're testing what will eventually become a multi-server setup. Logically speaking, cores are as separate as running Solr on two different machines, they just happen to live in the same servlet container on one machine. You must already have some kind of infrastructure in place to do your indexing, you have to either adjust that process to do the indexing twice or run two copies of it. Without cores, the base URL is http://HOST:PORT/solr/ ... with cores, it becomes http://HOST:PORT/solr/corename/ with corename being the variable part. Shawn
Re: 2 index within the same Solr server ?
i have implemented this works indexing document at first index (core0) http://localhost:8983/solr/core0/update/extract/?stream.file=path_of_filenamecommit=truehttp://localhost:8983/solr/core1/admin/ indexing document at first index (core) http://localhost:8983/solr/core1/update/extract/?stream.file=path_of_filenamecommit=truehttp://localhost:8983/solr/core1/admin/ On Thu, Mar 31, 2011 at 4:28 PM, Amel Fraisse a...@imaginatio.fr wrote: 2011/3/31 Deepak Singh deep...@praumtech.com I want 2 index in same solr server. How to create 2 index and its schema for two different search result Hi, You have to use SolrCore to create a solr.xml file in wich you specify 2 cores ( refer to the link : http://wiki.apache.org/solr/CoreAdmin ) But for indexing and searching I've the same question: I don't know how I could specify that document would be indexed a twice (in the first index and in the second index). Amel. On Wed, Mar 30, 2011 at 7:07 PM, Amel Fraisse amel.frai...@gmail.comwrote: Hello every body, referring to the link : http://wiki.apache.org/solr/CoreAdmin. I've created a solr.xml file as follows: solr persistent=true sharedLib=lib property name=snapshooter value=/home/solr-user/solr/ bin/snapshooter.sh / cores adminPath=/admin/cores shareSchema=false adminHandler=fr.splayce.solr.handler.MyAdminHandler core name=core1 instanceDir=core0 property name=dataDir value=/core0/data / /core core name=core2 instanceDir=core1/ property name=dataDir value=/core1/data / /cores /solr So before using SolrCore I instanciated a SolrServer to index and search documents as follows: System.setProperty(solr.solr.home, solr); CoreContainer.Initializer initializer = new CoreContainer.Initializer(); CoreContainer coreContainer = initializer.initialize(); server = new EmbeddedSolrServer(coreContainer, ); And then to index a document : server.add(doc) and to search : server.query(...). So with SolrCore I've create MyAdminHandler by overrinding handleCistomAction method like this (as mentionned in the link): protected boolean handleCustomAction(SolrQueryRequest req, SolrQueryResponse rsp) { CoreContainer container = super.getCoreContainer(); SolrCore mycore1 = container.getCore(core1); SolrCore mycore2 = container.getCore(core2); So how I could index and search document within the 2 indexes? Thank you for your help. 2011/3/29 Rahul Warawdekar rahul.warawde...@gmail.com Please refer http://wiki.apache.org/solr/MultipleIndexes On 3/29/11, Amel Fraisse amel.frai...@gmail.com wrote: Hello every body, Is it possible to create 2 index within the same Solr server ? Thank you. Amel. -- Thanks and Regards Rahul A. Warawdekar -- *Amel Fraisse* *Imaginatio SAS* *128 rue la Boétie 75008 PARIS Bureaux : 12 rue Martel - 75010 PARIS* http://compta.splayce.com
Re: 2 index within the same Solr server ?
Hi every body, This is my implementation SolrJ to instanciate 2 SolrCore. File f = new File (./solr/solr.xml); System.setProperty(solr.solr.home, solr); CoreContainer.Initializer initializer = new CoreContainer.Initializer(); CoreContainer coreContainer = initializer.initialize(); coreContainer.load(f.getParent(), f); SolrCore mycore0 = coreContainer.getCore(core0); SolrCore mycore1 = coreContainer.getCore(core1); servercore0 = new EmbeddedSolrServer(coreContainer, core0); servercore1 = new EmbeddedSolrServer(coreContainer, core1); But I have the follow bug: org.apache.solr.common.SolrException: No such core: core1 at org.apache.solr.client.solrj.embedded.EmbeddedSolrServer.request(EmbeddedSolrServer.java:104) The solr.xml file : solr persistent=true sharedLib=lib property name=snapshooter value=/home/solr-user/solr/bin/snapshooter.sh / cores adminPath=/admin/cores shareSchema=false core name=core0 instanceDir=core0 property name=dataDir value=core0/data / /core core name=core1 instanceDir=core1/ property name=dataDir value=core1/data / /cores /solr Amel. 2011/3/31 Amel Fraisse amel.frai...@gmail.com Hello Deepack, Thank you for your response. Yes I would doing the same thing with SolrJ. Amel. 2011/3/31 Deepak Singh deep...@praumtech.com i have implemented this works indexing document at first index (core0) http://localhost:8983/solr/core0/update/extract/?stream.file=path_of_filenamecommit=truehttp://localhost:8983/solr/core1/admin/ indexing document at first index (core) http://localhost:8983/solr/core1/update/extract/?stream.file=path_of_filenamecommit=truehttp://localhost:8983/solr/core1/admin/ On Thu, Mar 31, 2011 at 4:28 PM, Amel Fraisse a...@imaginatio.fr wrote: 2011/3/31 Deepak Singh deep...@praumtech.com I want 2 index in same solr server. How to create 2 index and its schema for two different search result Hi, You have to use SolrCore to create a solr.xml file in wich you specify 2 cores ( refer to the link : http://wiki.apache.org/solr/CoreAdmin ) But for indexing and searching I've the same question: I don't know how I could specify that document would be indexed a twice (in the first index and in the second index). Amel. On Wed, Mar 30, 2011 at 7:07 PM, Amel Fraisse amel.frai...@gmail.comwrote: Hello every body, referring to the link : http://wiki.apache.org/solr/CoreAdmin. I've created a solr.xml file as follows: solr persistent=true sharedLib=lib property name=snapshooter value=/home/solr-user/solr/ bin/snapshooter.sh / cores adminPath=/admin/cores shareSchema=false adminHandler=fr.splayce.solr.handler.MyAdminHandler core name=core1 instanceDir=core0 property name=dataDir value=/core0/data / /core core name=core2 instanceDir=core1/ property name=dataDir value=/core1/data / /cores /solr So before using SolrCore I instanciated a SolrServer to index and search documents as follows: System.setProperty(solr.solr.home, solr); CoreContainer.Initializer initializer = new CoreContainer.Initializer(); CoreContainer coreContainer = initializer.initialize(); server = new EmbeddedSolrServer(coreContainer, ); And then to index a document : server.add(doc) and to search : server.query(...). So with SolrCore I've create MyAdminHandler by overrinding handleCistomAction method like this (as mentionned in the link): protected boolean handleCustomAction(SolrQueryRequest req, SolrQueryResponse rsp) { CoreContainer container = super.getCoreContainer(); SolrCore mycore1 = container.getCore(core1); SolrCore mycore2 = container.getCore(core2); So how I could index and search document within the 2 indexes? Thank you for your help. 2011/3/29 Rahul Warawdekar rahul.warawde...@gmail.com Please refer http://wiki.apache.org/solr/MultipleIndexes On 3/29/11, Amel Fraisse amel.frai...@gmail.com wrote: Hello every body, Is it possible to create 2 index within the same Solr server ? Thank you. Amel. -- Thanks and Regards Rahul A. Warawdekar
Re: 2 index within the same Solr server ?
Hello every body, referring to the link : http://wiki.apache.org/solr/CoreAdmin. I've created a solr.xml file as follows: solr persistent=true sharedLib=lib property name=snapshooter value=/home/solr-user/solr/ bin/snapshooter.sh / cores adminPath=/admin/cores shareSchema=false adminHandler=fr.splayce.solr.handler.MyAdminHandler core name=core1 instanceDir=core0 property name=dataDir value=/core0/data / /core core name=core2 instanceDir=core1/ property name=dataDir value=/core1/data / /cores /solr So before using SolrCore I instanciated a SolrServer to index and search documents as follows: System.setProperty(solr.solr.home, solr); CoreContainer.Initializer initializer = new CoreContainer.Initializer(); CoreContainer coreContainer = initializer.initialize(); server = new EmbeddedSolrServer(coreContainer, ); And then to index a document : server.add(doc) and to search : server.query(...). So with SolrCore I've create MyAdminHandler by overrinding handleCistomAction method like this (as mentionned in the link): protected boolean handleCustomAction(SolrQueryRequest req, SolrQueryResponse rsp) { CoreContainer container = super.getCoreContainer(); SolrCore mycore1 = container.getCore(core1); SolrCore mycore2 = container.getCore(core2); So how I could index and search document within the 2 indexes? Thank you for your help. 2011/3/29 Rahul Warawdekar rahul.warawde...@gmail.com Please refer http://wiki.apache.org/solr/MultipleIndexes On 3/29/11, Amel Fraisse amel.frai...@gmail.com wrote: Hello every body, Is it possible to create 2 index within the same Solr server ? Thank you. Amel. -- Thanks and Regards Rahul A. Warawdekar
2 index within the same Solr server ?
Hello every body, Is it possible to create 2 index within the same Solr server ? Thank you. Amel.
Re: 2 index within the same Solr server ?
http://wiki.apache.org/solr/CoreAdmin Hello every body, Is it possible to create 2 index within the same Solr server ? Thank you. Amel.
Re: 2 index within the same Solr server ?
Yes, you can use multicore to create 2nd index from 1st index Sent from my iPhone On Mar 29, 2011, at 6:01, Amel Fraisse amel.frai...@gmail.com wrote: Hello every body, Is it possible to create 2 index within the same Solr server ? Thank you. Amel.
Re: 2 index within the same Solr server ?
Please refer http://wiki.apache.org/solr/MultipleIndexes On 3/29/11, Amel Fraisse amel.frai...@gmail.com wrote: Hello every body, Is it possible to create 2 index within the same Solr server ? Thank you. Amel. -- Thanks and Regards Rahul A. Warawdekar