Re: Custom Plugin exception : Plugin init failure for [schema.xml]

2013-11-02 Thread Parvin Gasimzade
Hi Shawn,

Thank you for your answer. I have solved the problem.

The problem is, in our code constructor of TurkishFilterFactory is setted
as protected and that works without problem on the 3.x versions of the Solr
but gives the exception that I mentioned here on 4.x versions. By analyzing
the stack trace I saw that it gives an InstantationException and by making
constructor public solves the problem.


On Fri, Nov 1, 2013 at 6:34 PM, Shawn Heisey  wrote:

> On 11/1/2013 4:18 AM, Parvin Gasimzade wrote:
> > I have a problem with custom plugin development in solr 4.x versions. I
> > have developed custom filter and trying to install it but I got following
> > exception.
>
> Later you indicated that you can use it with Solr 3.x without any problem.
>
> Did you recompile your custom plugin against the Solr jars from the new
> version?  There was a *huge* amount of java class refactoring that went
> into the 4.0 version as compared to any 3.x version, and that continues
> with each new 4.x release.
>
> I would bet that if you tried that recompile, it would fail due to
> errors and/or warnings, which you'll need to fix.  There might also be
> operational problems that the compiler doesn't find, due to changes in
> how the underlying APIs get used.
>
> Thanks,
> Shawn
>
>


Custom Plugin exception : Plugin init failure for [schema.xml]

2013-11-01 Thread Parvin Gasimzade
Hi all,

I have a problem with custom plugin development in solr 4.x versions. I
have developed custom filter and trying to install it but I got following
exception.

Schema xml :

  




  


Btw, I could not get any exception on 3.x versions. Any help will be
appreciated.

*Exception : *
org.apache.solr.common.SolrException: Plugin init failure for [schema.xml]
fieldType "text_tr": Plugin init failure for [schema.xml] analyzer/filter:
Error instantiating class: 'my_package.TurkishFilterFactory'
at
org.apache.solr.util.plugin.AbstractPluginLoader.load(AbstractPluginLoader.java:177)
at org.apache.solr.schema.IndexSchema.readSchema(IndexSchema.java:374)
at org.apache.solr.schema.IndexSchema.(IndexSchema.java:122)
at
org.apache.solr.core.CoreContainer.createFromLocal(CoreContainer.java:1018)
at org.apache.solr.core.CoreContainer.create(CoreContainer.java:1051)
at org.apache.solr.core.CoreContainer$3.call(CoreContainer.java:634)
at org.apache.solr.core.CoreContainer$3.call(CoreContainer.java:629)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:724)
Caused by: org.apache.solr.common.SolrException: Plugin init failure for
[schema.xml] analyzer/filter: Error instantiating class:
'my_package.TurkishFilterFactory'
at
org.apache.solr.util.plugin.AbstractPluginLoader.load(AbstractPluginLoader.java:177)
at
org.apache.solr.schema.FieldTypePluginLoader.readAnalyzer(FieldTypePluginLoader.java:392)
at
org.apache.solr.schema.FieldTypePluginLoader.create(FieldTypePluginLoader.java:95)
at
org.apache.solr.schema.FieldTypePluginLoader.create(FieldTypePluginLoader.java:43)
at
org.apache.solr.util.plugin.AbstractPluginLoader.load(AbstractPluginLoader.java:151)
... 14 more
Caused by: org.apache.solr.common.SolrException: Error instantiating class:
'my_package.TurkishFilterFactory'
at
org.apache.solr.core.SolrResourceLoader.newInstance(SolrResourceLoader.java:473)
at
org.apache.solr.util.plugin.AbstractPluginLoader.create(AbstractPluginLoader.java:89)
at
org.apache.solr.util.plugin.AbstractPluginLoader.load(AbstractPluginLoader.java:151)
... 18 more
Caused by: java.lang.InstantiationException: my_package.TurkishFilterFactory
at java.lang.Class.newInstance(Class.java:359)
at
org.apache.solr.core.SolrResourceLoader.newInstance(SolrResourceLoader.java:470)
... 20 more

Nov 01, 2013 11:59:27 AM org.apache.solr.common.SolrException log
SEVERE: null:org.apache.solr.common.SolrException: Unable to create core:
collection1
at
org.apache.solr.core.CoreContainer.recordAndThrow(CoreContainer.java:1672)
at org.apache.solr.core.CoreContainer.create(CoreContainer.java:1057)
at org.apache.solr.core.CoreContainer$3.call(CoreContainer.java:634)
at org.apache.solr.core.CoreContainer$3.call(CoreContainer.java:629)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:724)
Caused by: org.apache.solr.common.SolrException: Plugin init failure for
[schema.xml] fieldType "text_tr": Plugin init failure for [schema.xml]
analyzer/filter: Error instantiating class:
'my_package.TurkishFilterFactory'
at
org.apache.solr.util.plugin.AbstractPluginLoader.load(AbstractPluginLoader.java:177)
at org.apache.solr.schema.IndexSchema.readSchema(IndexSchema.java:374)
at org.apache.solr.schema.IndexSchema.(IndexSchema.java:122)
at
org.apache.solr.core.CoreContainer.createFromLocal(CoreContainer.java:1018)
at org.apache.solr.core.CoreContainer.create(CoreContainer.java:1051)
... 10 more
Caused by: org.apache.solr.common.SolrException: Plugin init failure for
[schema.xml] analyzer/filter: Error instantiating class:
'my_package.TurkishFilterFactory'
at
org.apache.solr.util.plugin.AbstractPluginLoader.load(AbstractPluginLoader.java:177)
at
org.apache.solr.schema.FieldTypePluginLoader.readAnalyzer(FieldTypePluginLoader.java:392)
at
org.apache.solr.schema.FieldTypePluginLoader.create(FieldTypePluginLoader.java:95)
at
org.apache.solr.schema.FieldTypePluginLoader.create(FieldTypePluginLoader.java:43)
at
org.apache.solr.util.plugin.AbstractPluginLoader.load(AbstractPluginLoader.j

Re: Max number of core in Solr multi-core

2013-01-07 Thread Parvin Gasimzade
I know that but my question is different. Let me ask it in this way.

I have a solr with base url localhost:8998/solr and two solr core
as localhost:8998/solr/core1 and localhost:8998/solr/core2.

I have one baseSolr instance initialized as :
SolrServer server = new HttpSolrServer( url );

I have also create SolrServer's for each core as :
SolrServer core1 = new HttpSolrServer( url + "/core1" );
SolrServer core2 = new HttpSolrServer( url + "/core2" );

Since there are many cores, I have to initialize SolrServer as shown above.
Is there a way to create only one SolrServer with the base url and access
each core using it? If it is possible, then I don't need to create new
SolrServer for each core.

On Mon, Jan 7, 2013 at 2:39 PM, Erick Erickson wrote:

> This might help:
> https://wiki.apache.org/solr/Solrj#HttpSolrServer
>
> Note that the associated SolrRequest takes the path, I presume relative to
> the base URL you initialized the HttpSolrServer with.
>
> Best
> Erick
>
>
> On Mon, Jan 7, 2013 at 7:02 AM, Parvin Gasimzade <
> parvin.gasimz...@gmail.com
> > wrote:
>
> > Thank you for your responses. I have one more question related to Solr
> > multi-core.
> > By using SolrJ I create new core for each application. When user wants to
> > add data or make query on his application, I create new HttpSolrServer
> for
> > this core. In this scenario there will be many running HttpSolrServer
> > instances.
> >
> > Is there a better solution? Does it cause a problem to run many instances
> > at the same time?
> >
> > On Wed, Jan 2, 2013 at 5:35 PM, Per Steffensen 
> > wrote:
> >
> > > g a collection per application instead of a core
> >
>


Re: Max number of core in Solr multi-core

2013-01-07 Thread Parvin Gasimzade
Thank you for your responses. I have one more question related to Solr
multi-core.
By using SolrJ I create new core for each application. When user wants to
add data or make query on his application, I create new HttpSolrServer for
this core. In this scenario there will be many running HttpSolrServer
instances.

Is there a better solution? Does it cause a problem to run many instances
at the same time?

On Wed, Jan 2, 2013 at 5:35 PM, Per Steffensen  wrote:

> g a collection per application instead of a core


Re: solr replication

2012-01-25 Thread Parvin Gasimzade
Hi Anderson,

Thank you for your effort.I will try this.
Hope it will solve my problem.

Regards

On Wed, Jan 25, 2012 at 2:27 PM, Anderson vasconcelos <
anderson.v...@gmail.com> wrote:

> Hi Parvin
>
> I did something that may help you. I set up apache (with mod_proxy and mode
> balance) like a front-end and use this to distruted the request of my
> aplication. Request for /update or /optmize, i'm redirect to master (or
> masters) server and requests /search i redirect to slaves. Example:
>
> 
> BalancerMember http://127.0.0.1:8080/apache-solr-1.4.1/ disablereuse=On
> route=jvm1
> 
>
> 
> BalancerMember http://127.0.0.1:8080/apache-solr-1.4.1/ disablereuse=On
> route=jvm1
> BalancerMember http://10.16.129.61:8080/apache-solr-1.4.1/ disablereuse=On
> route=jvm2
> 
>
> ProxyPassMatch /solrcluster(.*)/update(.*)$
> balancer://solrclusterindex$1/update$2
> ProxyPassMatch /solrcluster(.*)/select(.*)$
> balancer://solrclustersearch$1/select$2
>
> I hope it helps you
>


Re: solr replication

2012-01-25 Thread Parvin Gasimzade
Ok thank you for your response.

On Wed, Jan 25, 2012 at 12:24 PM, darul  wrote:

> I mean by grid the list of your instances :
>
> String masterUrl = "http://masterUrl/core/...";
> String[] slaveUrls = {"http://slaveUrl/core/...";,
> "http://slaveUrl/core/..."}
>
> Then use your business logic to use the correct one with Http solrJ facade.
>
> --
> View this message in context:
> http://lucene.472066.n3.nabble.com/solr-replication-tp3687106p3687314.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>


Re: solr replication

2012-01-25 Thread Parvin Gasimzade
Thank you for your response.
What you mean by Grid? Can you please send me any example or any link?


On Wed, Jan 25, 2012 at 11:30 AM, darul  wrote:

> You may define your specific configuration as a Grid with all your solr
> instances and then using SolrJ and CommonsHttpSolrServer choose the right
> url depending on indexation or search task.
>
> --
> View this message in context:
> http://lucene.472066.n3.nabble.com/solr-replication-tp3687106p3687208.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>


Re: solr replication

2012-01-25 Thread Parvin Gasimzade
Then as you say , shouldn't i define three SolrServer() using SolrJ?
For indexing call solrMasterServer, and for querying call solrSlaveServer1
or solrSlaveServer2?

On Wed, Jan 25, 2012 at 11:09 AM, darul  wrote:

> Here is the way I see it (and implemented it), while using SolrJ api you
> have
> to fire :
>
> - Indexation commands to your /indexation solr instance/ (master) example :
> http://myMaster:80/myCore/
> - Query commands to your /search solr instance/ (slave). You may have
> several slaves, and also find alternative as broker to make load balancing
> betweeen each
> http://mySlave1:80/myCore/
> http://mySlave2:80/myCore/
> ...
>
> You do not need any changes in code normally, replication is made
> automatically and defined in your solrconfig.xml configuration file.
>
> --
> View this message in context:
> http://lucene.472066.n3.nabble.com/solr-replication-tp3687106p3687168.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>


solr replication

2012-01-25 Thread Parvin Gasimzade
Hi all,

I try to setup solr replication by following
http://wiki.apache.org/solr/SolrReplication tutorial.Everything is working
ok.

My question is, should i define two SolrServer in Solrj (one for master and
one for slave) in order to redirect indexes into master and queries into
slave?

In the future if i want to add new slave then should i change code?

What is the recommended way?

Thanks in advance.

Regards


Re: Custom Solr FunctionQuery Error

2011-12-28 Thread Parvin Gasimzade
Thank you for your answers.

I have a Map and want to boost the score of that documents
during search time.

In my example i get that map inside ValueSource and boost the matched
documents score.

In the query if {!graph} is added then it will return boosted query
otherwise it will return regular list.

For this design , which classes should i extend? Or how can i solve that
issue?

Regards,
Parvin

On Thu, Dec 29, 2011 at 1:07 AM, Yonik Seeley wrote:

> On Wed, Dec 28, 2011 at 2:16 AM, Parvin Gasimzade
>  wrote:
> > I have created custom Solr FunctionQuery in Solr 3.4.
> > I extended ValueSourceParser, ValueSource, Query and QParserPlugin
> classes.
>
> Note that you only need a QParserPlugin implementation for top level
> query types, not function queries.
> With just a ValueSourceParser and ValueSource implementation, you can
> use the custom function as a function query.
>
> Example:
> q={!func}graph("myparameter")
>
> -Yonik
> http://www.lucidimagination.com
>


Custom Solr FunctionQuery Error

2011-12-27 Thread Parvin Gasimzade
Hi all,

I have created custom Solr FunctionQuery in Solr 3.4.
I extended ValueSourceParser, ValueSource, Query and QParserPlugin classes.

I set the name parameter as "graph" inside GraphQParserPlugin class.

But when try to search i got an error. Search queries are

http://localhost:8080/solr/select/?q={!graph}test
http://localhost:8080/solr/select/?q=test&defType=graph

I also add the * *into
solrConfig.xml but i got the same error...

Error message is :

Dec 27, 2011 7:05:20 PM org.apache.solr.common.SolrException log
SEVERE: org.apache.solr.common.SolrException: Unknown query type 'graph'
 at org.apache.solr.core.SolrCore.getQueryPlugin(SolrCore.java:1517)
at org.apache.solr.search.QParser.getParser(QParser.java:316)
 at
org.apache.solr.handler.component.QueryComponent.prepare(QueryComponent.java:80)
at
org.apache.solr.handler.component.SearchHandler.handleRequestBody(SearchHandler.java:173)
 at
org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:129)
at org.apache.solr.core.SolrCore.execute(SolrCore.java:1368)
 at
org.apache.solr.servlet.SolrDispatchFilter.execute(SolrDispatchFilter.java:356)
at
org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:252)
 at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
 at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
 at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at
org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
 at
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
 at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:224)
 at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:185)
at
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
 at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:151)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
 at
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:929)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
 at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:405)
at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:269)
 at
org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:515)
at
org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:300)
 at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
 at java.lang.Thread.run(Thread.java:679)

Thank you for your help.

Best Regards,
Parvin


Re: Casesensitive search problem

2011-11-14 Thread Parvin Gasimzade
Check this :
http://wiki.apache.org/solr/AnalyzersTokenizersTokenFilters#solr.LowerCaseFilterFactory

On Mon, Nov 14, 2011 at 3:24 PM, jayanta sahoo  wrote:

> Hi,
> Whenever I am searching with the words "OfficeJet" or "officejet" or
> "Officejet" or "oFiiIcejET". I am getting the different results for each
> search respectively. I am not able to understand why this is happening?
>   I want to solve this problem such a way that search will become case
> insensitive and I will get same result for any combination of capital and
> small letters.
>
> --
> Jayanta Sahoo
>


Re: JSON response with SolrJ

2011-09-21 Thread Parvin Gasimzade
Hi,

Similar question asked before.Maybe it can help.
http://lucene.472066.n3.nabble.com/SolrJ-Response-JSON-td1002024.html

On Wed, Sep 21, 2011 at 3:01 PM, Kissue Kissue  wrote:

> Hi,
>
> I am using solr 3.3 with SolrJ. Does anybody have any idea how i can
> retrieve JSON response with SolrJ? Is it possible? It seems to be more
> focused on XML and Beans.
>
> Thanks.
>


Re: please help! *:* followed by commit does not work

2011-09-07 Thread Parvin Gasimzade
Use this to clear the solr server.

http://localhost:8983/solr/update?stream.body=
*:*&commit=true


On Wed, Sep 7, 2011 at 10:48 AM, Roland Tollenaar wrote:

> Hi All,
>
> I want to clear the solr server and start loading documents afresh.
>
> According to the information I found on internet I would have to do
> somethign like this:
>
> http://localhost:8983/solr/**update?commit=true&-H&Content-**
> Type:&text/xml&--data-binary&
> '***:*'
>
> which in my case returns:
>
> 
>
> 
>
> 0 name=QTime>0
>
> 
>
>
> I have tried following this command up with:
>
>
> http://localhost:8983/solr/**update?commit=true&-H&Content-**
> Type:&text/xml&--data-binary&
> '**'
>
>
> and
>
> -http://localhost:8983/solr/**update?commit=true&-H&Content-**
> Type:&text/xml&--data-binary&
> '**'
>
>
> all of which reply with the same
>
> 
>
> 
>
> 0 name=QTime>0
>
> 
>
> response.
>
> But when I run a query, all data is still returned.
>
> I have also tried removing an entry specifically by id, exactly the same
> behaviour. Record is never deleted.
>
>
> Restarting the solr server after all this also does not help.
>
>
> I have also tried using curl but that complains to this line:
>
> >curl 
> >http://localhost:8983/solr/**update?commit=true-H
> > "Content-Type: text/xml" --data-binary '*:* **delete>'
>
>
> with:
>
> "< was unexpected at this time."
>
>
> no idea what to make of that..
>
>
> I hope someone can give some advice here.
>
> Thanks in advance.
>
>
> regards,
>
>
> Roland
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>