Portable Solr

2019-11-03 Thread Java Developer
Hi,

Like portable embedded web server (Spring Boot or Takes Or Rapid) Takes (
https://github.com/yegor256/takes) or Undertow (http://undertow.io/) or
Rapidoid (https://www.rapidoid.org/)

Do we have portable Solr server? Want to build an Web application with Solr
with portability?

The user needs should have only javaRest is portable...

Please advise.

Thanks


utilizenode doesn't work after cluster policy set

2019-11-03 Thread Yuan Zhao
Hi Team,

I came across a strange behavior:
When I use the default cluster policy like:
```
{
  "cluster-preferences":[
{
  "minimize":"cores",
  "precision":1},
{"maximize":"freedisk"}],
  "triggers":{".auto_add_replicas":{
  "name":".auto_add_replicas",
  "event":"nodeLost",
  "waitFor":120,
  "actions":[
{
  "name":"auto_add_replicas_plan",
  "class":"solr.AutoAddReplicasPlanAction"},
{
  "name":"execute_plan",
  "class":"solr.ExecutePlanAction"}],
  "enabled":true}},
  "listeners":{".auto_add_replicas.system":{
  "beforeAction":[],
  "afterAction":[],
  "trigger":".auto_add_replicas",
  "stage":[
"STARTED",
"ABORTED",
"SUCCEEDED",
"FAILED",
"BEFORE_ACTION",
"AFTER_ACTION",
"IGNORED"],
  "class":"org.apache.solr.cloud.autoscaling.SystemLogListener"}},
  "properties":{}}
```
I can run a utilize node to move replica to new nodes, but there is a
problem:
Before run the command, the replica placement like:
[image: 屏幕快照 2019-11-01 17.23.19.png]
After run utilize node command, sometimes the replica belongs to one shard
placed to a same node, which is not I want.
[image: 屏幕快照 2019-11-01 17.22.24.png]
Then I set the cluster policy with the command:

```
curl http://localhost:8983/solr/admin/autoscaling -H
'Content-type:application/json' -d '{
 "set-cluster-policy" : [{
  "replica" : "1",
  "shard" : "#EACH",
  "node" : "#ANY",
 }]
}'

curl http://localhost:8983/solr/admin/autoscaling -H
'Content-type:application/json' -d '{
 "set-trigger": {
  "name" : "node_added_trigger",
  "event" : "nodeAdded",
  "waitFor" : "5s",
  "preferredOperation": "ADDREPLICA",
  "enabled" : true,
  "actions" : [
   {
"name" : "compute_plan",
"class": "solr.ComputePlanAction"
   },
   {
"name" : "execute_plan",
"class": "solr.ExecutePlanAction"
   }
  ]
 }
}'
···
Then I send the utilize node command to move replica to new nodes, I found
the command doesn't work.
The replica placement like:

[image: 屏幕快照 2019-11-01 17.23.19.png]

It doesn't move any replica.
The autoscaling.json likes:
```
{
  "cluster-preferences":[
{
  "minimize":"cores",
  "precision":1},
{"maximize":"freedisk"}],
  "cluster-policy":[{
  "replica":"1",
  "shard":"#EACH",
  "node":"#ANY"}],
  "triggers":{
".auto_add_replicas":{
  "name":".auto_add_replicas",
  "event":"nodeLost",
  "waitFor":120,
  "actions":[
{
  "name":"auto_add_replicas_plan",
  "class":"solr.AutoAddReplicasPlanAction"},
{
  "name":"execute_plan",
  "class":"solr.ExecutePlanAction"}],
  "enabled":true},
"node_added_trigger":{
  "preferredOperation":"ADDREPLICA",
  "event":"nodeAdded",
  "waitFor":5,
  "actions":[
{
  "name":"compute_plan",
  "class":"solr.ComputePlanAction"},
{
  "name":"execute_plan",
  "class":"solr.ExecutePlanAction"}],
  "enabled":true}},
  "listeners":{
".auto_add_replicas.system":{
  "trigger":".auto_add_replicas",
  "afterAction":[],
  "stage":[
"STARTED",
"ABORTED",
"SUCCEEDED",
"FAILED",
"BEFORE_ACTION",
"AFTER_ACTION",
"IGNORED"],
  "class":"org.apache.solr.cloud.autoscaling.SystemLogListener",
  "beforeAction":[]},
"node_added_trigger.system":{
  "beforeAction":[],
  "afterAction":[],
  "trigger":"node_added_trigger",
  "stage":[
"STARTED",
"ABORTED",
"SUCCEEDED",
"FAILED",
"BEFORE_ACTION",
"AFTER_ACTION",
"IGNORED"],
  "class":"org.apache.solr.cloud.autoscaling.SystemLogListener"}},
  "properties":{}}
```

My solr version is 7.3. Do I use it in a wrong way?
-- 
Thanks & regards,
Yuan Zhao


Re: Query on stemming

2019-11-03 Thread Shubham Goswami
Hi Paras/Jorn

Thanks for your support. I am using Solr version 7.5.
I tried with SnowballPorterFilterFactory class and its working fine.
Thanks for your help.

On Fri, Nov 1, 2019 at 5:52 PM Paras Lehana 
wrote:

> Hi Shubham,
>
>  I am getting the ClassNotFoundException while indexing after making the
> > changes.
>
>
>
>- Please describe the error properly with full details. We need to see
>what is exactly causing ClassNotFoundException in the trace.
>- This seems to be a Java syntax error due to
>*EnglishPorterFilterFactory**.java* being not available. Please confirm
>if it's available in analysis directory.
>- Also, what Solr version are you using? *EnglishPorterFilterFactory* is
>already *deprecated* and I suggest you to use
>*SnowballPorterFilterFactory* with *language="English" *instead. You
>need to add the stemming in query time analysis chain too, otherwise,
> query
>as "bags" will not match with "bag" (indexed).
>
>
> Hope this helps.
>
> On Fri, 1 Nov 2019 at 15:42, Shubham Goswami 
> wrote:
>
> > Hi Jorn
> >
> > Thanks for your response.
> > Following is my field type definition and i am getting the
> > ClassNotFoundException while indexing after making the changes.
> > 
> >> positionIncrementGap="100" multiValued="true">
> > 
> >   
> >> ignoreCase="true"/>
> >   
> >   
> > 
> > 
> >   
> >> ignoreCase="true"/>
> >> ignoreCase="true" synonyms="synonyms.txt"/>
> >   
> >  
> >   
> >
> > On Fri, Nov 1, 2019 at 2:10 PM Jörn Franke  wrote:
> >
> > > How did you define the field type? Probably you have syntax errors
> there.
> > > I recommend to use the schema rest api instead of schema xml as it will
> > > give you better feedback on what is wrong and it allows you also better
> > > versioning of the schema in a source code repository.
> > >
> > > https://lucene.apache.org/solr/guide/8_2/schema-api.html
> > >
> > >
> > > > Am 01.11.2019 um 06:41 schrieb Shubham Goswami <
> > > shubham.gosw...@hotwax.co>:
> > > >
> > > > Hello Community
> > > >
> > > > I am using a filter class EnglishPorterFilterFactory for stemming
> > filter
> > > > but because of usage of this class, my solr is not able reload the
> > > schema.
> > > >
> > > > Can somebody please let me know what exactly this class does and how
> > can
> > > i
> > > > implement stemming ?
> > > > Any help will be appreciated. Thanks in advance.
> > > >
> > > > --
> > > > Kind Regards,
> > > > Shubham Goswami
> > > > Enterprise Software Engineer
> > > > mobile: +91 7803886288
> > > > email: *shubham.gosw...@hotwax.co*
> > > > *www.hotwax.co *
> > >
> >
> >
> > --
> > Kind Regards,
> > Shubham Goswami
> > Enterprise Software Engineer
> > mobile: +91 7803886288
> > email: *shubham.gosw...@hotwax.co*
> > *www.hotwax.co *
> >
>
>
> --
> --
> Regards,
>
> *Paras Lehana* [65871]
> Development Engineer, Auto-Suggest,
> IndiaMART Intermesh Ltd.
>
> 8th Floor, Tower A, Advant-Navis Business Park, Sector 142,
> Noida, UP, IN - 201303
>
> Mob.: +91-9560911996
> Work: 01203916600 | Extn:  *8173*
>
> --
> IMPORTANT:
> NEVER share your IndiaMART OTP/ Password with anyone.
>


-- 
Kind Regards,
Shubham Goswami
Enterprise Software Engineer
mobile: +91 7803886288
email: *shubham.gosw...@hotwax.co*
*www.hotwax.co *


Re: Portable Solr

2019-11-03 Thread Jörn Franke
Yes, simply search the mailing list or the web for embedded Solr and you will 
find what you need. Nevertheless, running embedded is just for development 
(also in case of Spring and others). Avoid it for an end user facing server 
application.

> Am 03.11.2019 um 17:02 schrieb Java Developer :
> 
> Hi,
> 
> Like portable embedded web server (Spring Boot or Takes Or Rapid) Takes (
> https://github.com/yegor256/takes) or Undertow (http://undertow.io/) or
> Rapidoid (https://www.rapidoid.org/)
> 
> Do we have portable Solr server? Want to build an Web application with Solr
> with portability?
> 
> The user needs should have only javaRest is portable...
> 
> Please advise.
> 
> Thanks