JAVA_HOME 指向JDK目录(非bin目录)
E:\Downloads\solr-9.0.0\solr-9.0.0\bin>solr start
Error: A JNI error has occurred, please check your installation and try again
Exception in thread "main" java.lang.UnsupportedClassVersionError: org/apache/solr/util/SolrCLI has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:756)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:468)
at java.net.URLClassLoader.access$100(URLClassLoader.java:74)
at java.net.URLClassLoader$1.run(URLClassLoader.java:369)
at java.net.URLClassLoader$1.run(URLClassLoader.java:363)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:362)
at java.lang.ClassLoader.loadClass(ClassLoader.java:418)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:355)
at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:495)
E:\Downloads\solr-9.0.0\solr-9.0.0\bin>
解决升级JDK版本 (solr9 用jdk-19就可以)
q查询参数
fq过滤查询
q和fq都是 key:value 格式
price:[100 TO 200] 区间查询,大写TO
sort参数 price desc 排序
start,rows 分页
fi 指定字段查询 id,name,price
hl高亮查询
分词器:
索引的建立
倒排索引-关键词对应文档id
1 我
2 喜欢
3 数学
过程个人理解:
关键词=》拆分=》拆分后的词=》文档id=》文档id计算分数=》文档id排序=》返回结果
正排索引-文档id对应文档
1 我,喜欢,数学
2 我,喜欢,编程
关键词=》文档id=》排序=》返回结果