Relevancy Score Calculation

2019-02-03 Thread Ashish Bisht
Hi,

Currently score is calculated based on "Max Doc"  instead of "Num Docs".Is
it possible to change it to "Num Docs"(i.e without deleted docs).Will it
require a code change or some config change.

Regards
Ashish



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


Re: Solr relevancy score different on replicated nodes

2019-02-03 Thread Ashish Bisht
Thanks Erick and everyone.We are checking on stats cache.

I noticed stats skew again and optimized the index to correct the same.As
per the documents.

https://lucidworks.com/2017/10/13/segment-merging-deleted-documents-optimize-may-bad/
and 
https://lucidworks.com/2018/06/20/solr-and-optimizing-your-index-take-ii/

wanted to check on below points considering we want stats skew to be
corrected.

1.When optimized single segment won't be natural merged easily.As we might
be doing manual optimize every time,what I visualize is at a certain point
in future we might be having a single large segment.What impact this large
segment is going to have?
Our index ~30k documents i.e files with content(Segment size <1Gb as of now)

1.Do you recommend going for optimize in these situations?Probably it will
be done only when stats skew.Is it safe?

Regards
Ashish

 




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


Re: Java object binding not working

2019-02-03 Thread Ray Niu
did you use multi values field?

On Sun, Feb 3, 2019 at 8:22 PM Swapnil Katkar  wrote:

> Greetings!
>
> I am working on a requirement where I want to query the data and want to
> do the object mapping for the retrieved result using Solrj. For this, I am
> referring to the official document at 
> *https://lucene.apache.org/solr/guide/7_6/using-solrj.html#java-object-binding
> .*
>  I
> set-up the necessary class files and the collections.
>
> With the help of this document, I can create the documents in the Solr DB,
> but it is not working for fetching and mapping the fields to the Java POJO
> class. To do the mapping, I used @Field annotation.
>
> Details are as below:
> *1)* Solrj version: 7.6.0
> *2)* The line of code which is not working: *List employees =
> response.getBeans(Employee.class);*
> *3)* Exception stack trace:
> *Caused by: java.lang.IllegalArgumentException: Can not set
> java.lang.String field demo.apache.solr.vo.Employee.name
>  to java.util.ArrayList*
> * at
> sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(Unknown
> Source)*
> * at
> sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(Unknown
> Source)*
> * at sun.reflect.UnsafeObjectFieldAccessorImpl.set(Unknown Source)*
> * at java.lang.reflect.Field.set(Unknown Source)*
> *4)* Collection was created using
> *solr.cmd create -c employees -s 2 -rf 2*
>
> Please find the attached source code files. Also, I attached the stack
> trace file. Can you please help me on how to resolve them?
>
> Regards,
> Swapnil Katkar
>


Java object binding not working

2019-02-03 Thread Swapnil Katkar
Greetings!

I am working on a requirement where I want to query the data and want to do
the object mapping for the retrieved result using Solrj. For this, I am
referring to the official document at
*https://lucene.apache.org/solr/guide/7_6/using-solrj.html#java-object-binding
.*
I
set-up the necessary class files and the collections.

With the help of this document, I can create the documents in the Solr DB,
but it is not working for fetching and mapping the fields to the Java POJO
class. To do the mapping, I used @Field annotation.

Details are as below:
*1)* Solrj version: 7.6.0
*2)* The line of code which is not working: *List employees =
response.getBeans(Employee.class);*
*3)* Exception stack trace:
*Caused by: java.lang.IllegalArgumentException: Can not set
java.lang.String field demo.apache.solr.vo.Employee.name
 to java.util.ArrayList*
* at
sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(Unknown
Source)*
* at
sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(Unknown
Source)*
* at sun.reflect.UnsafeObjectFieldAccessorImpl.set(Unknown Source)*
* at java.lang.reflect.Field.set(Unknown Source)*
*4)* Collection was created using
*solr.cmd create -c employees -s 2 -rf 2*

Please find the attached source code files. Also, I attached the stack
trace file. Can you please help me on how to resolve them?

Regards,
Swapnil Katkar
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further 
details.
Exception in thread "main" org.apache.solr.client.solrj.beans.BindingException: 
Could not instantiate object of class demo.apache.solr.vo.Employee
at 
org.apache.solr.client.solrj.beans.DocumentObjectBinder.getBean(DocumentObjectBinder.java:71)
at 
org.apache.solr.client.solrj.beans.DocumentObjectBinder.getBeans(DocumentObjectBinder.java:50)
at 
org.apache.solr.client.solrj.response.QueryResponse.getBeans(QueryResponse.java:628)
at 
demo.apache.solr.SolrObjMapper.retrieveDocuments(SolrObjMapper.java:60)
at demo.apache.solr.SolrObjMapper.main(SolrObjMapper.java:27)
Caused by: org.apache.solr.client.solrj.beans.BindingException: Exception while 
setting value : [Sam Martin] on public java.lang.String 
demo.apache.solr.vo.Employee.name
at 
org.apache.solr.client.solrj.beans.DocumentObjectBinder$DocField.set(DocumentObjectBinder.java:455)
at 
org.apache.solr.client.solrj.beans.DocumentObjectBinder$DocField.inject(DocumentObjectBinder.java:438)
at 
org.apache.solr.client.solrj.beans.DocumentObjectBinder.getBean(DocumentObjectBinder.java:67)
... 4 more
Caused by: java.lang.IllegalArgumentException: Can not set java.lang.String 
field demo.apache.solr.vo.Employee.name to java.util.ArrayList
at 
sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(Unknown 
Source)
at 
sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(Unknown 
Source)
at sun.reflect.UnsafeObjectFieldAccessorImpl.set(Unknown Source)
at java.lang.reflect.Field.set(Unknown Source)
at 
org.apache.solr.client.solrj.beans.DocumentObjectBinder$DocField.set(DocumentObjectBinder.java:449)
... 6 more


Solr -plugins Jar in Cloud mode

2019-02-03 Thread Lucky Sharma
Hi,
I was trying to  add plugins to solr-cloud by following
https://lucene.apache.org/solr/guide/6_6/adding-custom-plugins-in-solrcloud-mode.html

It works well for all other components, but It's giving an unknown
class exception when I use some custom analyzers with custom classes.

Any suggestions? what am I missing?

-- 
Warm Regards,

Lucky Sharma
Contact No :+91 9821559918


Re: Error getting replica locations : unable to get autoscaling policy session when creating collection

2019-02-03 Thread Zheng Lin Edwin Yeo
Hi,

I have found that the issue is due to the https clusterprop configuration
is not correctly loaded to zookeeper. As such, they are still communicating
on http, when Solr is already configured to use https.

Regards,
Edwin

On Sat, 2 Feb 2019 at 13:49, Zheng Lin Edwin Yeo 
wrote:

> Hi,
>
> I am using Solr 7.6.0.
>
> When I tried to create a collection, I encountered the error of unable to
> get autoscaling policy session.
>
> I have 2 replicas running, and I am creating it with the following command:
>
> https://localhost:8983/solr/admin/collections?action=CREATE=collection1=1=2=2=collection1
>
> What could be the reason that caused this error?
>
> This is the error which I am getting:
>
> Saturday, February 2, 2019 12:40:08 PM ERROR true
> OverseerCollectionMessageHandler Collection: calls operation: create
> failed:org.apache.solr.common.SolrException: Error getting replica
> locations : unable to get autoscaling policy session
>
> Collection: calls operation: create
> failed:org.apache.solr.common.SolrException: Error getting replica
> locations : unable to get autoscaling policy session
>
>  at
> org.apache.solr.cloud.api.collections.CreateCollectionCmd.call(CreateCollectionCmd.java:183)
>
>  at
> org.apache.solr.cloud.api.collections.OverseerCollectionMessageHandler.processMessage(OverseerCollectionMessageHandler.java:259)
>
>  at
> org.apache.solr.cloud.OverseerTaskProcessor$Runner.run(OverseerTaskProcessor.java:478)
>
>  at
> org.apache.solr.common.util.ExecutorUtil$MDCAwareThreadPoolExecutor.lambda$execute$0(ExecutorUtil.java:209)
>
>  at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
>
>  at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
>
>  at java.lang.Thread.run(Unknown Source)
>
> Caused by: org.apache.solr.common.SolrException: unable to get autoscaling
> policy session
>
>  at
> org.apache.solr.client.solrj.cloud.autoscaling.PolicyHelper.getReplicaLocations(PolicyHelper.java:123)
>
>  at
> org.apache.solr.cloud.api.collections.Assign.getPositionsUsingPolicy(Assign.java:369)
>
>  at
> org.apache.solr.cloud.api.collections.Assign$PolicyBasedAssignStrategy.assign(Assign.java:617)
>
>  at
> org.apache.solr.cloud.api.collections.CreateCollectionCmd.buildReplicaPositions(CreateCollectionCmd.java:394)
>
>  at
> org.apache.solr.cloud.api.collections.CreateCollectionCmd.call(CreateCollectionCmd.java:178)
>
>  ... 6 more
>
> Caused by: org.apache.solr.common.SolrException:
> org.apache.solr.common.SolrException:
>
>  at
> org.apache.solr.common.cloud.rule.ImplicitSnitch.getTags(ImplicitSnitch.java:78)
>
>  at
> org.apache.solr.client.solrj.impl.SolrClientNodeStateProvider.fetchTagValues(SolrClientNodeStateProvider.java:138)
>
>  at
> org.apache.solr.client.solrj.impl.SolrClientNodeStateProvider.getNodeValues(SolrClientNodeStateProvider.java:127)
>
>  at
> org.apache.solr.client.solrj.cloud.autoscaling.Row.(Row.java:66)
>
>  at
> org.apache.solr.client.solrj.cloud.autoscaling.Policy$Session.(Policy.java:566)
>
>  at
> org.apache.solr.client.solrj.cloud.autoscaling.Policy.createSession(Policy.java:391)
>
>  at
> org.apache.solr.client.solrj.cloud.autoscaling.Policy.createSession(Policy.java:353)
>
>  at
> org.apache.solr.client.solrj.cloud.autoscaling.PolicyHelper$SessionRef.createSession(PolicyHelper.java:460)
>
>  at
> org.apache.solr.client.solrj.cloud.autoscaling.PolicyHelper$SessionRef.get(PolicyHelper.java:425)
>
>  at
> org.apache.solr.client.solrj.cloud.autoscaling.PolicyHelper.getSession(PolicyHelper.java:481)
>
>  at
> org.apache.solr.client.solrj.cloud.autoscaling.PolicyHelper.getReplicaLocations(PolicyHelper.java:121)
>
>  ... 10 more
>
> Caused by: org.apache.solr.common.SolrException:
>
>  at
> org.apache.solr.client.solrj.impl.SolrClientNodeStateProvider$AutoScalingSnitch.getRemoteInfo(SolrClientNodeStateProvider.java:301)
>
>  at
> org.apache.solr.common.cloud.rule.ImplicitSnitch.getTags(ImplicitSnitch.java:76)
>
>  ... 20 more
>
> Caused by: org.apache.solr.client.solrj.SolrServerException: IOException
> occured when talking to server at: http://10.33.42.58:8983/edm
>
>  at
> org.apache.solr.client.solrj.impl.HttpSolrClient.executeMethod(HttpSolrClient.java:657)
>
>  at
> org.apache.solr.client.solrj.impl.HttpSolrClient.request(HttpSolrClient.java:255)
>
>  at
> org.apache.solr.client.solrj.impl.HttpSolrClient.request(HttpSolrClient.java:244)
>
>  at
> org.apache.solr.client.solrj.SolrClient.request(SolrClient.java:1260)
>
>  at
> org.apache.solr.client.solrj.impl.SolrClientNodeStateProvider$ClientSnitchCtx.invoke(SolrClientNodeStateProvider.java:349)
>
>  at
> org.apache.solr.client.solrj.impl.SolrClientNodeStateProvider$AutoScalingSnitch.getRemoteInfo(SolrClientNodeStateProvider.java:274)
>
>  ... 21 more
>
> Caused by: org.apache.http.client.ClientProtocolException
>
>  at
>