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 ~$alpha` <la...@gmail.com> on 2018/02/17 07:55:40 UTC

Solr Plugins Documentation

I got a basic understanding of how we can create the custom Solr plugin as
illustrated in link
https://dzone.com/articles/create-custom-solr-queryparser

But I don't know the next step as for how can we create a jar.
like do we need to import Solr source code ??

It would be of great help if someone can share the complete step to how to
create custom sort 

Note : I have basic understanding of java and surely can write java code 



--
Sent from: http://lucene.472066.n3.nabble.com/Solr-User-f472068.html

Re: Solr Plugins Documentation

Posted by Emir Arnautović <em...@sematext.com>.
Hi,
It is not query parser but update request processor, but you can find simple buildable Solr plugin on https://github.com/od-bits/solr-multivaluefield-processor <https://github.com/od-bits/solr-multivaluefield-processor>. You can also find a related blogpost that has some details how to build, configure and test it: http://www.od-bits.com/2018/02/solr-docvalues-on-analysed-field.html <http://www.od-bits.com/2018/02/solr-docvalues-on-analysed-field.html>

HTH,
Emir
--
Monitoring - Log Management - Alerting - Anomaly Detection
Solr & Elasticsearch Consulting Support Training - http://sematext.com/



> On 17 Feb 2018, at 23:50, Howe, David <Da...@auspost.com.au> wrote:
> 
> 
> You will need to use your favourite java tooling to take the code that you have written and package it as a jar file.  In my case, we use maven so I have set my custom extensions up as a maven project, and in my POM file (which tells maven what dependencies your project has), I declare:
> 
>    <dependencies>
>        <dependency>
>            <groupId>org.apache.solr</groupId>
>            <artifactId>solr-core</artifactId>
>            <version>6.4.0</version>
>            <scope>provided</scope>
>        </dependency>
>    <dependencies>
> 
> This puts the Solr core classes on my classpath when I am compiling, but does not package them up when I am building my jar file (scope=provided).
> 
> Once you have written your extension class, running mvn clean install will create your jar file for you.  You then need to copy that jar file into the solr/server/solr/lib directory so that Solr can find it and put it on the classpath.  You should then be able to reference your custom extension in the Solr config.
> 
> See https://maven.apache.org/ for details on maven.
> See https://docs.oracle.com/javase/tutorial/deployment/jar/basicsindex.html for the basics on jar files.
> 
> If you use a tool like IntelliJ or Exclipse, they have maven and jar file support built in.
> 
> Regards,
> 
> David
> 
> David Howe
> Java Domain Architect
> Postal Systems
> Level 16, 111 Bourke Street Melbourne VIC 3000
> 
> T  0391067904
> 
> M  0424036591
> 
> E  David.Howe@auspost.com.au
> 
> W  auspost.com.au
> W  startrack.com.au
> 
> Australia Post is committed to providing our customers with excellent service. If we can assist you in any way please telephone 13 13 18 or visit our website.
> 
> The information contained in this email communication may be proprietary, confidential or legally professionally privileged. It is intended exclusively for the individual or entity to which it is addressed. You should only read, disclose, re-transmit, copy, distribute, act in reliance on or commercialise the information if you are authorised to do so. Australia Post does not represent, warrant or guarantee that the integrity of this email communication has been maintained nor that the communication is free of errors, virus or interference.
> 
> If you are not the addressee or intended recipient please notify us by replying direct to the sender and then destroy any electronic or paper copy of this message. Any views expressed in this email communication are taken to be those of the individual sender, except where the sender specifically attributes those views to Australia Post and is authorised to do so.
> 
> Please consider the environment before printing this email.


RE: Solr Plugins Documentation

Posted by "Howe, David" <Da...@auspost.com.au>.
You will need to use your favourite java tooling to take the code that you have written and package it as a jar file.  In my case, we use maven so I have set my custom extensions up as a maven project, and in my POM file (which tells maven what dependencies your project has), I declare:

    <dependencies>
        <dependency>
            <groupId>org.apache.solr</groupId>
            <artifactId>solr-core</artifactId>
            <version>6.4.0</version>
            <scope>provided</scope>
        </dependency>
    <dependencies>

This puts the Solr core classes on my classpath when I am compiling, but does not package them up when I am building my jar file (scope=provided).

Once you have written your extension class, running mvn clean install will create your jar file for you.  You then need to copy that jar file into the solr/server/solr/lib directory so that Solr can find it and put it on the classpath.  You should then be able to reference your custom extension in the Solr config.

See https://maven.apache.org/ for details on maven.
See https://docs.oracle.com/javase/tutorial/deployment/jar/basicsindex.html for the basics on jar files.

If you use a tool like IntelliJ or Exclipse, they have maven and jar file support built in.

Regards,

David

David Howe
Java Domain Architect
Postal Systems
Level 16, 111 Bourke Street Melbourne VIC 3000

T  0391067904

M  0424036591

E  David.Howe@auspost.com.au

W  auspost.com.au
W  startrack.com.au

Australia Post is committed to providing our customers with excellent service. If we can assist you in any way please telephone 13 13 18 or visit our website.

The information contained in this email communication may be proprietary, confidential or legally professionally privileged. It is intended exclusively for the individual or entity to which it is addressed. You should only read, disclose, re-transmit, copy, distribute, act in reliance on or commercialise the information if you are authorised to do so. Australia Post does not represent, warrant or guarantee that the integrity of this email communication has been maintained nor that the communication is free of errors, virus or interference.

If you are not the addressee or intended recipient please notify us by replying direct to the sender and then destroy any electronic or paper copy of this message. Any views expressed in this email communication are taken to be those of the individual sender, except where the sender specifically attributes those views to Australia Post and is authorised to do so.

Please consider the environment before printing this email.