You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Kamal Kishore Aggarwal <kk...@gmail.com> on 2014/05/19 09:10:27 UTC

Custom filter not working with solr 4.7.1

Dear Team,

I have created a custom filter factory for solr 4.2. It is working good.
But when I am trying to upgarde solr-4.2 to 4.7 version, it is reporting
errors.

Caused by: org.apache.solr.common.SolrException: Plugin init failure for
[schema.xml] analyzer/filter: Error instantiating class:
'org.apache.lucene.analysis.ExtendedNameFilterFactory'

Here's the java code :http://pastebin.com/REu6cJxR,
http://pastebin.com/380YZaAM

It was working good with solr 4.2. Can anybody tell me the changes that I
need to make for running it in solr 4.7.1?


With Regards & Thanks

Kamal Kishore

Re: Custom filter not working with solr 4.7.1

Posted by Dmitry Kan <so...@gmail.com>.
Kamal,

Alexandre was pointing not to what java version you are compiling with, but
what are the lucene and solr jar files you compile and run against.
What is your build system -- ant or maven or ..?


On Tue, Jun 3, 2014 at 2:03 PM, Kamal Kishore Aggarwal <
kkroyal.192@gmail.com> wrote:

> Even after making the same java version, it is not working. I am using
>
> java.​runtime.​version:1.7.0_55-b13
>
>
>
>
>
>
>
>
> On Tue, Jun 3, 2014 at 2:05 PM, rulinma <ru...@gmail.com> wrote:
>
> > normal, rewrite filter.
> >
> >
> >
> > --
> > View this message in context:
> >
> http://lucene.472066.n3.nabble.com/Custom-filter-not-working-with-solr-4-7-1-tp4136824p4139506.html
> > Sent from the Solr - User mailing list archive at Nabble.com.
> >
>



-- 
Dmitry Kan
Blog: http://dmitrykan.blogspot.com
Twitter: http://twitter.com/dmitrykan

Re: Custom filter not working with solr 4.7.1

Posted by Kamal Kishore Aggarwal <kk...@gmail.com>.
Even after making the same java version, it is not working. I am using

java.​runtime.​version:1.7.0_55-b13








On Tue, Jun 3, 2014 at 2:05 PM, rulinma <ru...@gmail.com> wrote:

> normal, rewrite filter.
>
>
>
> --
> View this message in context:
> http://lucene.472066.n3.nabble.com/Custom-filter-not-working-with-solr-4-7-1-tp4136824p4139506.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>

Re: Custom filter not working with solr 4.7.1

Posted by rulinma <ru...@gmail.com>.
normal, rewrite filter.



--
View this message in context: http://lucene.472066.n3.nabble.com/Custom-filter-not-working-with-solr-4-7-1-tp4136824p4139506.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: Custom filter not working with solr 4.7.1

Posted by Alexandre Rafalovitch <ar...@gmail.com>.
I think the init method signatures changed. Just compare the same
factory across two Solr versions and you will see.

Regards,
   Alex.
Personal website: http://www.outerthoughts.com/
Current project: http://www.solr-start.com/ - Accelerating your Solr proficiency


On Mon, May 19, 2014 at 2:10 PM, Kamal Kishore Aggarwal
<kk...@gmail.com> wrote:
> Dear Team,
>
> I have created a custom filter factory for solr 4.2. It is working good.
> But when I am trying to upgarde solr-4.2 to 4.7 version, it is reporting
> errors.
>
> Caused by: org.apache.solr.common.SolrException: Plugin init failure for
> [schema.xml] analyzer/filter: Error instantiating class:
> 'org.apache.lucene.analysis.ExtendedNameFilterFactory'
>
> Here's the java code :http://pastebin.com/REu6cJxR,
> http://pastebin.com/380YZaAM
>
> It was working good with solr 4.2. Can anybody tell me the changes that I
> need to make for running it in solr 4.7.1?
>
>
> With Regards & Thanks
>
> Kamal Kishore

Re: Custom filter not working with solr 4.7.1

Posted by Kamal Kishore Aggarwal <kk...@gmail.com>.
I am new to solr. I am not getting your answer. Can you please explain in
more detail.


On Mon, May 19, 2014 at 4:02 PM, Kamal Kishore Aggarwal <
kkroyal.192@gmail.com> wrote:

> I am new to solr. I am not getting your answer. Can you please explain in
> more detail.
>
>
> On Mon, May 19, 2014 at 12:40 PM, Kamal Kishore Aggarwal <
> kkroyal.192@gmail.com> wrote:
>
>> Dear Team,
>>
>> I have created a custom filter factory for solr 4.2. It is working good.
>> But when I am trying to upgarde solr-4.2 to 4.7 version, it is reporting
>> errors.
>>
>> Caused by: org.apache.solr.common.SolrException: Plugin init failure for
>> [schema.xml] analyzer/filter: Error instantiating class:
>> 'org.apache.lucene.analysis.ExtendedNameFilterFactory'
>>
>> Here's the java code :http://pastebin.com/REu6cJxR,
>> http://pastebin.com/380YZaAM
>>
>> It was working good with solr 4.2. Can anybody tell me the changes that I
>> need to make for running it in solr 4.7.1?
>>
>>
>> With Regards & Thanks
>>
>> Kamal Kishore
>>
>>
>>
>

Re: Custom filter not working with solr 4.7.1

Posted by Kamal Kishore Aggarwal <kk...@gmail.com>.
I am new to solr. I am not getting your answer. Can you please explain in
more detail.


On Mon, May 19, 2014 at 12:40 PM, Kamal Kishore Aggarwal <
kkroyal.192@gmail.com> wrote:

> Dear Team,
>
> I have created a custom filter factory for solr 4.2. It is working good.
> But when I am trying to upgarde solr-4.2 to 4.7 version, it is reporting
> errors.
>
> Caused by: org.apache.solr.common.SolrException: Plugin init failure for
> [schema.xml] analyzer/filter: Error instantiating class:
> 'org.apache.lucene.analysis.ExtendedNameFilterFactory'
>
> Here's the java code :http://pastebin.com/REu6cJxR,
> http://pastebin.com/380YZaAM
>
> It was working good with solr 4.2. Can anybody tell me the changes that I
> need to make for running it in solr 4.7.1?
>
>
> With Regards & Thanks
>
> Kamal Kishore
>
>
>

Re: Custom filter not working with solr 4.7.1

Posted by Alexandre Rafalovitch <ar...@gmail.com>.
Are you sure you are compiling with the same version of Java and Solr
libraries that you are executing with? I would double-check your
CLASSPATH for those two environments.

Regards,
   Alex.
Personal website: http://www.outerthoughts.com/
Current project: http://www.solr-start.com/ - Accelerating your Solr proficiency


On Tue, Jun 3, 2014 at 3:11 PM, Kamal Kishore Aggarwal
<kk...@gmail.com> wrote:
> Hi,
>
> I have changed the code. But now it is showing the following errors:
>
> Caused by: java.lang.NoSuchMethodException:
> org.apache.lucene.analysis.ExtendedNameFilterFactory.<init>(java.util.Map)
> Here's the new java code : http://pastebin.com/J8q4JLgP
>
> A urgent help is appreciated. :)
>
> Thanks
> Kamal
>
>
> On Wed, May 21, 2014 at 1:38 PM, Kamal Kishore Aggarwal <
> kkroyal.192@gmail.com> wrote:
>
>> Thanks Shawn for quick reply.
>>
>> I am trying to change the code (removing the errors from the code shown in
>> image) & will test the filter after that & will update here.
>>
>> Thanks
>> Kamal Kishore
>>
>>
>> On Mon, May 19, 2014 at 10:17 PM, Shawn Heisey <so...@elyograg.org> wrote:
>>
>>> On 5/19/2014 1:10 AM, Kamal Kishore Aggarwal wrote:
>>> > I have created a custom filter factory for solr 4.2. It is working good.
>>> > But when I am trying to upgarde solr-4.2 to 4.7 version, it is reporting
>>> > errors.
>>> >
>>> > Caused by: org.apache.solr.common.SolrException: Plugin init failure for
>>> > [schema.xml] analyzer/filter: Error instantiating class:
>>> > 'org.apache.lucene.analysis.ExtendedNameFilterFactory'
>>> >
>>> > Here's the java code :http://pastebin.com/REu6cJxR,
>>> > http://pastebin.com/380YZaAM
>>> >
>>> > It was working good with solr 4.2. Can anybody tell me the changes that
>>> I
>>> > need to make for running it in solr 4.7.1?
>>>
>>> I probably would have used something like com.company.lucene.filter as
>>> the package name, but what you name the package is up to you, and will
>>> have no effect on your problem.
>>>
>>> I dropped your code into a trunk checkout (the code that will eventually
>>> become Lucene/Solr 5.0).  The Eclipse editor looked like this for your
>>> factory class:
>>>
>>> https://www.dropbox.com/s/tobjrk0riq7vqqt/extendednamefilterfactory.png
>>>
>>> The errors shown for the three red marks are:
>>>
>>> * Implicit super constructor TokenFilterFactory() is undefined for
>>> default constructor. Must define an explicit constructor.
>>> * The method init(Map<String,String>) is undefined for the type
>>> TokenFilterFactory.
>>> * The method getInt(Map<String,String>, String, int) in the type
>>> AbstractAnalysisFactory is not applicable for the arguments (String, int)
>>>
>>> I don't have easy access to a 4.x checkout right this minute, but the
>>> errors there are probably similar.
>>>
>>> Your actual filter class was all good except for three eclipse warnings
>>> that are fixed by adding a type argument of <String> to the code.
>>>
>>> Thanks,
>>> Shawn
>>>
>>>
>>

Re: Custom filter not working with solr 4.7.1

Posted by Kamal Kishore Aggarwal <kk...@gmail.com>.
Hi,

I have changed the code. But now it is showing the following errors:

Caused by: java.lang.NoSuchMethodException:
org.apache.lucene.analysis.ExtendedNameFilterFactory.<init>(java.util.Map)
Here's the new java code : http://pastebin.com/J8q4JLgP

A urgent help is appreciated. :)

Thanks
Kamal


On Wed, May 21, 2014 at 1:38 PM, Kamal Kishore Aggarwal <
kkroyal.192@gmail.com> wrote:

> Thanks Shawn for quick reply.
>
> I am trying to change the code (removing the errors from the code shown in
> image) & will test the filter after that & will update here.
>
> Thanks
> Kamal Kishore
>
>
> On Mon, May 19, 2014 at 10:17 PM, Shawn Heisey <so...@elyograg.org> wrote:
>
>> On 5/19/2014 1:10 AM, Kamal Kishore Aggarwal wrote:
>> > I have created a custom filter factory for solr 4.2. It is working good.
>> > But when I am trying to upgarde solr-4.2 to 4.7 version, it is reporting
>> > errors.
>> >
>> > Caused by: org.apache.solr.common.SolrException: Plugin init failure for
>> > [schema.xml] analyzer/filter: Error instantiating class:
>> > 'org.apache.lucene.analysis.ExtendedNameFilterFactory'
>> >
>> > Here's the java code :http://pastebin.com/REu6cJxR,
>> > http://pastebin.com/380YZaAM
>> >
>> > It was working good with solr 4.2. Can anybody tell me the changes that
>> I
>> > need to make for running it in solr 4.7.1?
>>
>> I probably would have used something like com.company.lucene.filter as
>> the package name, but what you name the package is up to you, and will
>> have no effect on your problem.
>>
>> I dropped your code into a trunk checkout (the code that will eventually
>> become Lucene/Solr 5.0).  The Eclipse editor looked like this for your
>> factory class:
>>
>> https://www.dropbox.com/s/tobjrk0riq7vqqt/extendednamefilterfactory.png
>>
>> The errors shown for the three red marks are:
>>
>> * Implicit super constructor TokenFilterFactory() is undefined for
>> default constructor. Must define an explicit constructor.
>> * The method init(Map<String,String>) is undefined for the type
>> TokenFilterFactory.
>> * The method getInt(Map<String,String>, String, int) in the type
>> AbstractAnalysisFactory is not applicable for the arguments (String, int)
>>
>> I don't have easy access to a 4.x checkout right this minute, but the
>> errors there are probably similar.
>>
>> Your actual filter class was all good except for three eclipse warnings
>> that are fixed by adding a type argument of <String> to the code.
>>
>> Thanks,
>> Shawn
>>
>>
>

Re: Custom filter not working with solr 4.7.1

Posted by Kamal Kishore Aggarwal <kk...@gmail.com>.
Thanks Shawn for quick reply.

I am trying to change the code (removing the errors from the code shown in
image) & will test the filter after that & will update here.

Thanks
Kamal Kishore


On Mon, May 19, 2014 at 10:17 PM, Shawn Heisey <so...@elyograg.org> wrote:

> On 5/19/2014 1:10 AM, Kamal Kishore Aggarwal wrote:
> > I have created a custom filter factory for solr 4.2. It is working good.
> > But when I am trying to upgarde solr-4.2 to 4.7 version, it is reporting
> > errors.
> >
> > Caused by: org.apache.solr.common.SolrException: Plugin init failure for
> > [schema.xml] analyzer/filter: Error instantiating class:
> > 'org.apache.lucene.analysis.ExtendedNameFilterFactory'
> >
> > Here's the java code :http://pastebin.com/REu6cJxR,
> > http://pastebin.com/380YZaAM
> >
> > It was working good with solr 4.2. Can anybody tell me the changes that I
> > need to make for running it in solr 4.7.1?
>
> I probably would have used something like com.company.lucene.filter as
> the package name, but what you name the package is up to you, and will
> have no effect on your problem.
>
> I dropped your code into a trunk checkout (the code that will eventually
> become Lucene/Solr 5.0).  The Eclipse editor looked like this for your
> factory class:
>
> https://www.dropbox.com/s/tobjrk0riq7vqqt/extendednamefilterfactory.png
>
> The errors shown for the three red marks are:
>
> * Implicit super constructor TokenFilterFactory() is undefined for
> default constructor. Must define an explicit constructor.
> * The method init(Map<String,String>) is undefined for the type
> TokenFilterFactory.
> * The method getInt(Map<String,String>, String, int) in the type
> AbstractAnalysisFactory is not applicable for the arguments (String, int)
>
> I don't have easy access to a 4.x checkout right this minute, but the
> errors there are probably similar.
>
> Your actual filter class was all good except for three eclipse warnings
> that are fixed by adding a type argument of <String> to the code.
>
> Thanks,
> Shawn
>
>

Re: Custom filter not working with solr 4.7.1

Posted by Shawn Heisey <so...@elyograg.org>.
On 5/19/2014 1:10 AM, Kamal Kishore Aggarwal wrote:
> I have created a custom filter factory for solr 4.2. It is working good.
> But when I am trying to upgarde solr-4.2 to 4.7 version, it is reporting
> errors.
>
> Caused by: org.apache.solr.common.SolrException: Plugin init failure for
> [schema.xml] analyzer/filter: Error instantiating class:
> 'org.apache.lucene.analysis.ExtendedNameFilterFactory'
>
> Here's the java code :http://pastebin.com/REu6cJxR,
> http://pastebin.com/380YZaAM
>
> It was working good with solr 4.2. Can anybody tell me the changes that I
> need to make for running it in solr 4.7.1?

I probably would have used something like com.company.lucene.filter as
the package name, but what you name the package is up to you, and will
have no effect on your problem.

I dropped your code into a trunk checkout (the code that will eventually
become Lucene/Solr 5.0).  The Eclipse editor looked like this for your
factory class:

https://www.dropbox.com/s/tobjrk0riq7vqqt/extendednamefilterfactory.png

The errors shown for the three red marks are:

* Implicit super constructor TokenFilterFactory() is undefined for
default constructor. Must define an explicit constructor.
* The method init(Map<String,String>) is undefined for the type
TokenFilterFactory.
* The method getInt(Map<String,String>, String, int) in the type
AbstractAnalysisFactory is not applicable for the arguments (String, int)

I don't have easy access to a 4.x checkout right this minute, but the
errors there are probably similar.

Your actual filter class was all good except for three eclipse warnings
that are fixed by adding a type argument of <String> to the code.

Thanks,
Shawn