Solr模糊匹配比完全匹配具有更好的分数(Solr fuzzy match has better score than exact match)
我在Solr进行模糊搜索,在极少数情况下,精确匹配的分数低于模糊匹配。 我甚至找到了使用debugQuery的原因:模糊匹配匹配了3个不同的单词,而精确匹配只匹配了一个。 因此,3个匹配的“总和”比1更有价值。 这是“解释”的一部分。
有没有办法配置Solr排名高于模糊的精确匹配,即使在这种情况下?
PS我已经使用
omitTermFreqAndPositions="true" omitNorms="true"
,但如果我们对不同的单词进行模糊匹配则无效。I'm doing a fuzzy search in Solr, and in rare cases the exact match has score lower than a fuzzy match. I even found a reason using debugQuery: fuzzy match has matched 3 different words, and exact match matched only one. So the "sum of" 3 matches got better value, than one. Here is part of the "explain".
Is there any way to configure Solr for ranking exact matches higher than fuzzy, even in this case?
P.S. I already using
omitTermFreqAndPositions="true" omitNorms="true"
, but it doesn't help if we have a fuzzy match against different words.
原文:https://stackoverflow.com/questions/20526342
最满意答案
看来
set -e
在命令替换的上下文中是无效的,如:for c in $(gen); do echo c done
但是,
set -e
在直接函数调用的上下文中工作,如:gen
使用
set -e
编写可靠的shell脚本很难或几乎不可能。 请改用显式错误处理。 你可以在这里阅读更多相关信息: BashFAQ / 105It appears that
set -e
is ineffective in the context of command substitution, as in:for c in $(gen); do echo c done
However,
set -e
does work in the context of straight function invocation, as in:gen
It is hard or near impossible to write reliable shell scripts with
set -e
. Use explicit error handling instead. You can read more about this here: BashFAQ/105
相关问答
更多-
如果我要用python制作一个小游戏,应该做什么准备工作?[2022-03-03]
e -
不是直接的,但您可以将以下内容添加到每个有执行内容的行。 || goto :error 然后定义会停止脚本的错误。 :error exit /b %errorlevel% Not directly but you can add the following to every line which has something to execute. || goto :error And then define error, which stops the script. :error exit /b % ...
-
测试1 如果你想让set -e的行为甚至在函数内部应用,那么除了set -e之外还使用set -E (aka set -o errtrace ): set -E -e foo () ( echo $SHELLOPTS false echo set -e failed ) echo test1: foo test $? -ne 0 && echo died echo echo test2: foo && echo died 但是,请注意,如果函数失败,则会触发退出而不是返回 。 ...
-
使用 [ -n "$var" ] || die "result is empty" 这样,如果$var非空,则整个语句的返回值为true,因此不会触发ERR陷阱。 Use [ -n "$var" ] || die "result is empty" This way, the return value of the entire statement is true if $var is non-empty, so the ERR trap is not triggered.
-
集合
和集合 [2023-08-01]是一样的吗?(Collection and Set are the same?) 好问题。 我认为明确地将一个Set的概念与一个Collection的概念相比较的主要目的是实际上正式区分这些概念。 假设你正在写一个方法 void x(Collection> c); 你不会有同样的想法,你想得到什么论点,就好像你在写 void x(Set> s); 第二种方法期望最多包含每个元素的Sets (即Sets )。 这与第一种方法有很大的语义差异,它不关心它是否接收Sets , Lists或任何其他类型的Collection 如果仔细观察, Set方法的Javadoc也是不同的,明确 ... -
你的问题是你file = fopen(dir->d_name, "r"); 不知道该文件在目录中的位置。 你需要给它完整的路径。 你可以这样做; struct dirent *dir; // put the directory path here. on windows is \ instead of / char *path = "/Users/adnis/CLion/Stackoverflow/testdir"; char *slash = ""; DIR *d = ...
-
仅供参考,替代FOR循环方法: @Echo Off (Set _yyyy=%DATE:~10,4%) Echo= It's %_yyyy% (Set _fold=dir1 dir2 dir3 dir4) Echo= %_fold% :: Loop through each Set _fold. Call :Loop %_fold% Pause Exit/B :Loop :: Copy files from local to remote for each sub directory If Not E ...
-
这是因为-e选项。 您需要确保测试错误返回状态: man sh -e ( man bash对此更加冗长,但本着同样的精神) 如果不是交互式,则在任何未经测试的命令失败时立即退出。 如果命令用于控制if,elif,while或until,则认为命令的退出状态是显式测试的; 或者如果命令是“&&”或“||”运算符的左手操作数。 这是一个使用bundler mock的示例(在sh中,但也应该在bash中工作): #!/bin/sh set -e bundle(){ echo "i'm errorring he ...
-
即使使用“set -e”,for循环中的函数调用也不会失败(Function invocation in for loop does not fail even with “set -e”)[2020-02-18]
看来set -e在命令替换的上下文中是无效的,如: for c in $(gen); do echo c done 但是, set -e在直接函数调用的上下文中工作,如: gen 使用set -e编写可靠的shell脚本很难或几乎不可能。 请改用显式错误处理。 你可以在这里阅读更多相关信息: BashFAQ / 105 It appears that set -e is ineffective in the context of command substitution, as in: for c ... -
Angular E2E-可以在循环中调用'It'函数吗?(Angular E2E- Is it possible to call an 'It' function in a loop?)[2022-02-15]
it可能是异步的,尝试用词法来限定它。 var dataLength = window.test.parameters.length; for (var i = 0; i < dataLength; i++){ it('should create a report for index: ', function(i) { return function () { var parameterObject = window.test.parameters[i]; ...