iotashan / cfsolrlib Goto Github PK
View Code? Open in Web Editor NEWColdFusion library for advanced Solr integration
License: MIT License
ColdFusion library for advanced Solr integration
License: MIT License
APPLICATION.tika = APPLICATION.javaloader.create("org.apache.tika.Tika").init();
is throwing
lucee.runtime.exp.NativeException: Magic match pattern is null
at org.apache.tika.detect.MagicDetector.(MagicDetector.java:281)
at org.apache.tika.detect.MagicDetector.parse(MagicDetector.java:63)
at org.apache.tika.mime.MagicMatch.getDetector(MagicMatch.java:54)
at org.apache.tika.mime.MagicMatch.size(MagicMatch.java:71)
at org.apache.tika.mime.Magic.size(Magic.java:55)
at org.apache.tika.mime.Magic.compareTo(Magic.java:65)
at org.apache.tika.mime.Magic.compareTo(Magic.java:25)
at java.util.ComparableTimSort.binarySort(ComparableTimSort.java:262)
at java.util.ComparableTimSort.sort(ComparableTimSort.java:207)
at java.util.Arrays.sort(Arrays.java:1312)
at java.util.Arrays.sort(Arrays.java:1506)
at java.util.ArrayList.sort(ArrayList.java:1454)
at java.util.Collections.sort(Collections.java:141)
at org.apache.tika.mime.MimeTypes.init(MimeTypes.java:393)
at org.apache.tika.mime.MimeTypesFactory.create(MimeTypesFactory.java:66)
at org.apache.tika.mime.MimeTypesFactory.create(MimeTypesFactory.java:93)
at org.apache.tika.mime.MimeTypesFactory.create(MimeTypesFactory.java:149)
at org.apache.tika.mime.MimeTypes.getDefaultMimeTypes(MimeTypes.java:479)
at org.apache.tika.config.TikaConfig.getDefaultMimeTypes(TikaConfig.java:60)
at org.apache.tika.config.TikaConfig.(TikaConfig.java:169)
at org.apache.tika.config.TikaConfig.getDefaultConfig(TikaConfig.java:268)
at org.apache.tika.Tika.(Tika.java:93)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
at lucee.runtime.reflection.pairs.ConstructorInstance.invoke(ConstructorInstance.java:52)
Lucee 5.x, Java 1.8.x, 64 bit Amazon Linux
Using the latest master, there are errors on instantiation:
==> /opt/lucee/tomcat/logs/catalina.out <==
28-Oct-2015 08:28:49.806 INFO [http-nio-8888-exec-1] org.apache.solr.client.solrj.impl.HttpClientUtil.createClient Creating new http client, config:maxConnections=128&maxConnectionsPerHost=32&followRedirects=false
log4j:ERROR A "org.apache.log4j.RollingFileAppender" object is not assignable to a "org.apache.log4j.Appender" variable.
log4j:ERROR The class "org.apache.log4j.Appender" was loaded by
log4j:ERROR [com.compoundtheory.classloader.NetworkClassLoader@6ba96347] whereas object of type
log4j:ERROR "org.apache.log4j.RollingFileAppender" was loaded by [java.net.URLClassLoader@61e4705b].
log4j:ERROR Could not instantiate appender named "file".
28-Oct-2015 08:28:50.052 INFO [http-nio-8888-exec-1] org.apache.solr.client.solrj.impl.HttpClientUtil.createClient Creating new http client, config:maxConnections=128&maxConnectionsPerHost=32&followRedirects=false
If I go back to the libraries from before the logging libraries were downgraded for ACF 9, I have better results:
==> /opt/lucee/tomcat/logs/catalina.out <==
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/var/www/vmhost/apps/mysite/cfml/deployment_root/wwwroot/requirements/solrj/javalib/slf4j-jdk14-1.6.6.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/var/www/vmhost/apps/mysite/cfml/deployment_root/wwwroot/requirements/solrj/javalib/tika-app-1.2.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.slf4j.impl.JDK14LoggerFactory]
28-Oct-2015 09:27:53.336 INFO [http-nio-8888-exec-1] org.apache.solr.client.solrj.impl.HttpClientUtil.createClient Creating new http client, config:maxConnections=128&maxConnectionsPerHost=32&followRedirects=false
28-Oct-2015 09:27:53.505 INFO [http-nio-8888-exec-1] org.apache.solr.client.solrj.impl.HttpClientUtil.createClient Creating new http client, config:maxConnections=128&maxConnectionsPerHost=32&followRedirects=false
It seems not completely clean (hence the "multiple bindings" message), so maybe there's still a tweak to be made, but I guess it's better than errors.
Is it time to branch for an old (ACF9-compatible) version and move on with upgrades?
For what it's worth, I haven't noticed any functional problems with either configuration, so far.
If I want to add a file to the index, but not be limited to the metadata in the file, there is currently no way to override that data. For example, a PDF file might have a "title" metadata field. However, I may want to use a different title for that file rather than the one stored in the metadata. Many users are unaware of the metadata fields in Word Docs and PDFs and leave them as the default. If they are uploading a file to a content management system, they may assign a different title, summary, etc and would expect that data to be indexed.
I suggest that another argument be added to the addFile method that accepts an array of structs that override the metadata values.
I expected something like
ampleSolrInstance.search(q=t,start=0,end=100,params={sort='score desc',fl=["id","name","title","score"]})
to change the fields returned to include each documents score, but it doesn't. Is 'params' not the place to pass in additional parameters ?
I was trying to get back the same as doing
http://localhost:8983/solr/select/?q=brown&fl=id,name,title,position,score&sort=score desc
directly.
Reading the JavaDocs of ...solrj.SolrQuery wasn't very insightful sadly.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.