Re: How to create indexes for CSV dataset (with schema) in Java

2023-01-27 Thread Jan Høydahl
Start Solr
bin/solr start -c

Create collection
bin/solr create -c books

Inject some CVS data: 
https://github.com/apache/solr/blob/main/solr/example/exampledocs/books.csv
bin/post -c books example/exampledocs/books.csv

Query to see only books with price from $7:
http://localhost:8983/solr/#/books/query?q=*:*&fq=price:%5B7%20TO%20*%5D

You could of course query this from Java using our SolrJ client library.

Perhaps that is a starting point for you to formulate in a better way what you 
are trying to achieve?

Jan

> 27. jan. 2023 kl. 08:38 skrev marc nicole :
> 
> In, java i want to create index of a collection named person and say an
> "Age" attribute for the values between 20 and 35. so that when i query Solr
> on those values it retrieves them quickly how to do that ?
> 
> Le ven. 27 janv. 2023 à 03:42, Shawn Heisey  a écrit :
> 
>> On 1/26/2023 2:22 PM, marc nicole wrote:
>>> Hello - I want to know how it is possible to create indexes for a certain
>>> attribute (and its different values) of a document, using Java.
>> 
>> This is a pretty vague question.  We need details of exactly what you're
>> trying to do and what the environment looks like.
>> 
>> Thanks,
>> Shawn
>> 
>> 



Re: Recommended Java version on Ubuntu 20.04, GC

2023-01-27 Thread Shawn Heisey

On 1/27/23 00:19, Adam Sjøgren wrote:

Any tips on reasonable settings for ZGC on a 80 node Solr cloud with ~3B
documents in a handful of collections and quite a bit of updates?


This is my /etc/default/solr.in.sh config on my little install for Dovecot:

SOLR_PID_DIR="/var/solr"
SOLR_HOME="/var/solr/data"
LOG4J_PROPS="/var/solr/log4j2.xml"
SOLR_LOGS_DIR="/var/solr/logs"
SOLR_PORT="8983"
SOLR_HEAP="1g"
GC_TUNE=" \
  -XX:+UnlockExperimentalVMOptions \
  -XX:+UseZGC \
  -XX:+ParallelRefProcEnabled \
  -XX:+ExplicitGCInvokesConcurrent \
  -XX:+UseStringDeduplication \
  -XX:+AlwaysPreTouch \
  -XX:+UseNUMA \
"
SOLR_JAVA_STACK_SIZE="-Xss1m"
SOLR_ULIMIT_CHECKS=false
SOLR_GZIP_ENABLED=true
SOLR_JETTY_HOST=0.0.0.0
SOLR_MODE="solrcloud"
SOLR_MODULES="analysis-extras"

I don't think there are any settings in this GC_TUNE that might vary 
based on the specific server environment.


This is the Java version:

openjdk version "17.0.5" 2022-10-18
OpenJDK Runtime Environment (build 17.0.5+8-Ubuntu-2ubuntu120.04)
OpenJDK 64-Bit Server VM (build 17.0.5+8-Ubuntu-2ubuntu120.04, mixed 
mode, sharing)


Thanks,
Shawn


Re: How to create indexes for CSV dataset (with schema) in Java

2023-01-27 Thread marc nicole
I don't understand something,
does Solr make the indexing automatically when the data are injected into
it through a POST request (so that when querying the data from Solr (e.g.
through this query
http://localhost:8983/solr/#/books/query?q=*:*&fq=price:%5B7%20TO%20*%5D)
the query is achieved faster)? or do I have to define some indexing
operations over the data attributes?

Le ven. 27 janv. 2023 à 15:06, Jan Høydahl  a écrit :

> Start Solr
> bin/solr start -c
>
> Create collection
> bin/solr create -c books
>
> Inject some CVS data:
> https://github.com/apache/solr/blob/main/solr/example/exampledocs/books.csv
> bin/post
> 
> -c books example/exampledocs/books.csv
>
> Query to see only books with price from $7:
> http://localhost:8983/solr/#/books/query?q=*:*&fq=price:%5B7%20TO%20*%5D
>
> You could of course query this from Java using our SolrJ client library.
>
> Perhaps that is a starting point for you to formulate in a better way what
> you are trying to achieve?
>
> Jan
>
> > 27. jan. 2023 kl. 08:38 skrev marc nicole :
> >
> > In, java i want to create index of a collection named person and say an
> > "Age" attribute for the values between 20 and 35. so that when i query
> Solr
> > on those values it retrieves them quickly how to do that ?
> >
> > Le ven. 27 janv. 2023 à 03:42, Shawn Heisey  a
> écrit :
> >
> >> On 1/26/2023 2:22 PM, marc nicole wrote:
> >>> Hello - I want to know how it is possible to create indexes for a
> certain
> >>> attribute (and its different values) of a document, using Java.
> >>
> >> This is a pretty vague question.  We need details of exactly what you're
> >> trying to do and what the environment looks like.
> >>
> >> Thanks,
> >> Shawn
> >>
> >>
>
>


Fresh install resulting in error

2023-01-27 Thread Matthew Castrigno
Hello,

We have been running SOLR 9.0 on Red Hat nix. We spun up another server and 
installed SOLR 9.0 on it.
We believe we have identical installs however the same calls produce this 500 
error.
Any insights are appreciated.
Thank you,
Matthew
HTTP ERROR 500 java.lang.NoClassDefFoundError: Lorg/apache/lucene/index/Term;
URI:/solr/talix/index
STATUS: 500
MESSAGE:java.lang.NoClassDefFoundError: Lorg/apache/lucene/index/Term;
SERVLET:default
CAUSED BY:  java.lang.NoClassDefFoundError: Lorg/apache/lucene/index/Term;
CAUSED BY:  java.lang.ClassNotFoundException: org.apache.lucene.index.Term
Caused by:

java.lang.NoClassDefFoundError: Lorg/apache/lucene/index/Term;
at java.base/java.lang.Class.getDeclaredFields0(Native Method)
at java.base/java.lang.Class.privateGetDeclaredFields(Class.java:3061)
at java.base/java.lang.Class.privateGetPublicFields(Class.java:3088)
at java.base/java.lang.Class.getFields(Class.java:1814)
at 
jdk.dynalink/jdk.dynalink.beans.FacetIntrospector.getFields(FacetIntrospector.java:112)
at 
jdk.dynalink/jdk.dynalink.beans.AbstractJavaLinker.(AbstractJavaLinker.java:138)
at jdk.dynalink/jdk.dynalink.beans.BeanLinker.(BeanLinker.java:92)
at 
jdk.dynalink/jdk.dynalink.beans.BeansLinker$1.computeValue(BeansLinker.java:144)
at 
jdk.dynalink/jdk.dynalink.beans.BeansLinker$1.computeValue(BeansLinker.java:136)
at java.base/java.lang.ClassValue.getFromHashMap(ClassValue.java:228)
at java.base/java.lang.ClassValue.getFromBackup(ClassValue.java:210)
at java.base/java.lang.ClassValue.get(ClassValue.java:116)
at 
jdk.dynalink/jdk.dynalink.beans.BeansLinker.getStaticLinkerForClass(BeansLinker.java:210)
at 
jdk.dynalink/jdk.dynalink.beans.BeansLinker.getLinkerForClass(BeansLinker.java:180)
at 
jdk.dynalink/jdk.dynalink.beans.BeansLinker.getGuardedInvocation(BeansLinker.java:333)
at 
jdk.scripting.nashorn/jdk.nashorn.internal.runtime.linker.NashornBeansLinker.getGuardedInvocation(NashornBeansLinker.java:169)
at 
jdk.scripting.nashorn/jdk.nashorn.internal.runtime.linker.NashornBeansLinker.getGuardedInvocation(NashornBeansLinker.java:156)
at 
jdk.dynalink/jdk.dynalink.linker.support.CompositeGuardingDynamicLinker.getGuardedInvocation(CompositeGuardingDynamicLinker.java:109)
at 
jdk.dynalink/jdk.dynalink.LinkerServicesImpl.lambda$getGuardedInvocation$0(LinkerServicesImpl.java:137)
at 
jdk.dynalink/jdk.dynalink.LinkerServicesImpl.getWithLookupInternal(LinkerServicesImpl.java:168)
at 
jdk.dynalink/jdk.dynalink.LinkerServicesImpl.getGuardedInvocation(LinkerServicesImpl.java:135)
at 
jdk.dynalink/jdk.dynalink.DynamicLinker.relink(DynamicLinker.java:242)
at 
jdk.scripting.nashorn.scripts/jdk.nashorn.internal.scripts.Script$Recompilation$4$331A$\^eval\_.processAdd(:22)
at 
jdk.scripting.nashorn/jdk.nashorn.internal.runtime.ScriptFunctionData.invoke(ScriptFunctionData.java:657)
at 
jdk.scripting.nashorn/jdk.nashorn.internal.runtime.ScriptFunction.invoke(ScriptFunction.java:513)
at 
jdk.scripting.nashorn/jdk.nashorn.internal.runtime.ScriptRuntime.apply(ScriptRuntime.java:527)
at 
jdk.scripting.nashorn/jdk.nashorn.api.scripting.ScriptObjectMirror.callMember(ScriptObjectMirror.java:202)
at 
jdk.scripting.nashorn/jdk.nashorn.api.scripting.NashornScriptEngine.invokeImpl(NashornScriptEngine.java:393)
at 
jdk.scripting.nashorn/jdk.nashorn.api.scripting.NashornScriptEngine.invokeFunction(NashornScriptEngine.java:197)
at 
org.apache.solr.scripting.update.ScriptUpdateProcessorFactory$ScriptUpdateProcessor.invokeFunctionUnsafe(ScriptUpdateProcessorFactory.java:446)
at 
org.apache.solr.scripting.update.ScriptUpdateProcessorFactory$ScriptUpdateProcessor$1.run(ScriptUpdateProcessorFactory.java:436)
at 
org.apache.solr.scripting.update.ScriptUpdateProcessorFactory$ScriptUpdateProcessor$1.run(ScriptUpdateProcessorFactory.java:433)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at 
org.apache.solr.scripting.update.ScriptUpdateProcessorFactory$ScriptUpdateProcessor.invokeFunction(ScriptUpdateProcessorFactory.java:432)
at 
org.apache.solr.scripting.update.ScriptUpdateProcessorFactory$ScriptUpdateProcessor.processAdd(ScriptUpdateProcessorFactory.java:386)
at 
org.apache.solr.handler.loader.JsonLoader$SingleThreadedJsonLoader$1.handle(JsonLoader.java:286)
at 
org.apache.solr.common.util.JsonRecordReader$Node.handleObjectStart(JsonRecordReader.java:369)
at 
org.apache.solr.common.util.JsonRecordReader$Node.parse(JsonRecordReader.java:270)
at 
org.apache.solr.common.util.JsonRecordReader.streamRecords(JsonRecordReader.java:124)
at 
org.apache.solr.handler.loader.JsonLoader$SingleThreadedJsonLoader.handleSplitMode(JsonLoader.java:264)
at 
org.apache.solr.handler.

Re: Fresh install resulting in error

2023-01-27 Thread Shawn Heisey

On 1/27/23 13:09, Matthew Castrigno wrote:
We have been running SOLR 9.0 on Red Hat nix. We spun up another server 
and installed SOLR 9.0 on it.
We believe we have identical installs however the same calls produce 
this 500 error.


Getting java.lang.NoClassDefFoundError: Lorg/apache/lucene/index/Term; 
means that it's not able to find a very core Lucene class.  I see two 
possible causes, with the second being more likely:


* The install wasn't complete and there are jar files missing.

* You have loaded the core Lucene jars more than once.  They should get 
loaded once just from the default Solr install, but by enabling some 
non-default functionality, you may have caused them to get loaded again. 
 Java tends to have issues when the same jar gets loaded more than 
once, or when the install already has a jar and a different version of 
that jar also gets loaded.


Thanks,
Shawn


Re: Fresh install resulting in error

2023-01-27 Thread Matthew Castrigno

Thank you Shawn.
We do use one jar not listed in the default configuration.
What do steps do you recommend to resolve these potential causes?
We have attempted the install multiple times. Is there a particular order of 
operations?
We installed and then copied the core into the appropriate directory and 
restarted the service.

Thank you for your insights.


 [cid:f3d25570-5ac3-400c-aa2b-65941d61d1fa]

Matthew Castrigno

IHT Developer II

St. Luke’s Health System

•  208-859-4276
•  castr...@slhs.org


From: Shawn Heisey 
Sent: Friday, January 27, 2023 1:34 PM
To: users@solr.apache.org 
Subject: Re: Fresh install resulting in error

On 1/27/23 13: 09, Matthew Castrigno wrote: > We have been running SOLR 9. 0 on 
Red Hat nix. We spun up another server > and installed SOLR 9. 0 on it. > We 
believe we have identical installs however the same calls produce > this 500
ZjQcmQRYFpfptBannerStart
This Message Is From an External Sender
This message came from outside the St. Luke's email system.

ZjQcmQRYFpfptBannerEnd

On 1/27/23 13:09, Matthew Castrigno wrote:
> We have been running SOLR 9.0 on Red Hat nix. We spun up another server
> and installed SOLR 9.0 on it.
> We believe we have identical installs however the same calls produce
> this 500 error.

Getting java.lang.NoClassDefFoundError: Lorg/apache/lucene/index/Term;
means that it's not able to find a very core Lucene class.  I see two
possible causes, with the second being more likely:

* The install wasn't complete and there are jar files missing.

* You have loaded the core Lucene jars more than once.  They should get
loaded once just from the default Solr install, but by enabling some
non-default functionality, you may have caused them to get loaded again.
  Java tends to have issues when the same jar gets loaded more than
once, or when the install already has a jar and a different version of
that jar also gets loaded.

Thanks,
Shawn


--
"This message is intended for the use of the person or entity to which it is 
addressed and may contain information that is confidential or privileged, the 
disclosure of which is governed by applicable law. If the reader of this 
message is not the intended recipient, you are hereby notified that any 
dissemination, distribution, or copying of this information is strictly 
prohibited. If you have received this message by error, please notify us 
immediately and destroy the related message."


Re: Fresh install resulting in error

2023-01-27 Thread Shawn Heisey

On 1/27/2023 2:08 PM, Matthew Castrigno wrote:

We do use one jar not listed in the default configuration.
What do steps do you recommend to resolve these potential causes?
We have attempted the install multiple times. Is there a particular 
order of operations?
We installed and then copied the core into the appropriate directory and 
restarted the service.


Can you describe exactly what you did to install and configure Solr, 
including anything related to loading extra jars?


Thanks,
Shawn


Re: Fresh install resulting in error

2023-01-27 Thread Matthew Castrigno

Thank you Shawn.

This process was used for the install:
https://tecadmin.net/how-to-install-apache-solr-on-centos-8/

As for the jar, this line was added into solrconfig.xml
  



From: Shawn Heisey 
Sent: Friday, January 27, 2023 2:55 PM
To: users@solr.apache.org 
Subject: Re: Fresh install resulting in error

On 1/27/2023 2: 08 PM, Matthew Castrigno wrote: > We do use one jar not listed 
in the default configuration. > What do steps do you recommend to resolve these 
potential causes? > We have attempted the install multiple times. Is there
ZjQcmQRYFpfptBannerStart
This Message Is From an External Sender
This message came from outside the St. Luke's email system.

ZjQcmQRYFpfptBannerEnd

On 1/27/2023 2:08 PM, Matthew Castrigno wrote:
> We do use one jar not listed in the default configuration.
> What do steps do you recommend to resolve these potential causes?
> We have attempted the install multiple times. Is there a particular
> order of operations?
> We installed and then copied the core into the appropriate directory and
> restarted the service.

Can you describe exactly what you did to install and configure Solr,
including anything related to loading extra jars?

Thanks,
Shawn


--
"This message is intended for the use of the person or entity to which it is 
addressed and may contain information that is confidential or privileged, the 
disclosure of which is governed by applicable law. If the reader of this 
message is not the intended recipient, you are hereby notified that any 
dissemination, distribution, or copying of this information is strictly 
prohibited. If you have received this message by error, please notify us 
immediately and destroy the related message."