Solr Copyfield在动态字段regexp问题上(Solr Copyfield on dynamic fields regexp issue)
我试图复制一些动态字段进行拼写检查。 但是,那 。 以下是schema.xml中的相关字段:
<dynamicField name="*_text_fr" stored="false" type="text_fr" multiValued="true" indexed="true"/> <dynamicField name="*_text_frs" stored="true" type="text_fr" multiValued="true" indexed="true"/> <dynamicField name="*_text_frms" stored="true" type="text_fr" multiValued="true" indexed="true"/>
它不会复制任何内容:
<copyField source="*_text_fr*" dest="textSpellFr" />
但是,它适用于:
<copyField source="*_text_fr" dest="textSpellFr" /> <copyField source="*_text_frs" dest="textSpellFr" /> <copyField source="*_text_frms" dest="textSpellFr" />
为什么第一个选项不工作?
I'm trying to copy some dynamic fields for spellchecking. However, the . Below are the relevant fields from schema.xml:
<dynamicField name="*_text_fr" stored="false" type="text_fr" multiValued="true" indexed="true"/> <dynamicField name="*_text_frs" stored="true" type="text_fr" multiValued="true" indexed="true"/> <dynamicField name="*_text_frms" stored="true" type="text_fr" multiValued="true" indexed="true"/>
It doesn't copy anything with:
<copyField source="*_text_fr*" dest="textSpellFr" />
However, it works with:
<copyField source="*_text_fr" dest="textSpellFr" /> <copyField source="*_text_frs" dest="textSpellFr" /> <copyField source="*_text_frms" dest="textSpellFr" />
Why doesn't the first option work?
原文:https://stackoverflow.com/questions/5311426
更新时间:2024-04-02 13:04
最满意答案
此版本不使用
For /R
:For /F "Delims=" %%A In ('Dir/B/AD-L "%~1"') Do If Exist "%~1\%%A\docs\" ( For /F "Delims=" %%B In ('Dir/B/S/A-D-L "%~1\%%A\docs\*.docx"' ) Do Echo=Copy "%%~B" "%CD%\edited") Pause
如果您对cmd窗口中的输出感到满意,请删除第4行和第3行的
Echo=
, 记住未编辑您的目标路径 。This version doesn't use
For /R
:For /F "Delims=" %%A In ('Dir/B/AD-L "%~1"') Do If Exist "%~1\%%A\docs\" ( For /F "Delims=" %%B In ('Dir/B/S/A-D-L "%~1\%%A\docs\*.docx"' ) Do Echo=Copy "%%~B" "%CD%\edited") Pause
Remove line 4 and
Echo=
on line 3 if you're happy with the output in the cmd window, remembering to unedit your destination path.
相关问答
更多-
沈阳好的电脑培训学校????[2022-03-12]
f -
Windows批处理具有处理嵌套变量的“有趣”方式。 这篇文章可能有帮助。 就个人而言,当我的批处理文件变得复杂时,我会切换到另一种语言。 我的第一选择通常是Python,但是如果你想留在微软生态系统中,那么vbscript或PowerShell就可以了。 Windows batch has an "interesting" way of handling nested variables. This article might help. Personally, when my batch files g ...
-
尝试使用: @echo off @setlocal enabledelayedexpansion set a=123,456,789 :a for /f "delims=," %%i in ("%a%") do ( echo %%i set a=!a:%%i=! goto a ) Try using: @echo off @setlocal enabledelayedexpansion set a=123,456,789 :a for /f "delims=," %%i in ("%a%" ...
-
此版本不使用For /R : For /F "Delims=" %%A In ('Dir/B/AD-L "%~1"') Do If Exist "%~1\%%A\docs\" ( For /F "Delims=" %%B In ('Dir/B/S/A-D-L "%~1\%%A\docs\*.docx"' ) Do Echo=Copy "%%~B" "%CD%\edited") Pause 如果您对cmd窗口中的输出感到满意,请删除第4行和第3行的Echo= , 记住未编辑您的目标路径 。 ...
-
批处理文件IF ELSE失败(Batch file IF ELSE fails)[2023-08-18]
您的IF声明似乎是正确的。 我尝试了(在Windows 7上),IMDISK和FOR循环注释掉了,它运行得很好。 这是我跑的批次。 @ECHO OFF :: SETLOCAL :: IF "%USERNAME%" EQU "jdoe" ( ECHO jdoe User Found REM IMDISK -a -s 32M -m #: -p "/FS:exFAT /Q /Y /V:MERGEABLES" REM FOR /F "tokens=2 delims==" %%D IN ('W ... -
运行第一个变量后,批处理文件中的嵌套for循环关闭(Nested for loop in batch file closes after running the first variable)[2023-04-29]
wmic logicaldisk get caption, drivetype, filesystem | find "3" | find "NTFS" | find /v "Caption" > "tmp_drives.txt" setlocal enableDelayedExpansion for /f "delims=:" %%A in (tmp_drives.txt) do ( dir %%A:\ /ad /s /b >> "%%A_dir.txt" set drive=%%A if e ... -
首先,使用 @echo off >c:\data.txt ping 8.8.4.4 在重定向器重定向该标准设备号之前直接作为数字,而不是stdout 然后单独替换前3个项目中的文件名 'findstr /R "^Packets: Sent =.$" c:\data.txt' 从文件中选择适当的行。 你需要确保tokens和delims选项与你第一个发布的例程中的选项相匹配(第一个使用令牌4和delim ,但你的第二个例程使用令牌3和delims作为一个空格) - 也就是假设你的第一个代码工作令人满意。 ...
-
你很困惑何时需要逃避一个角色。 某些字符具有特殊含义(您描述的“代码”)。 通常,您可以转义角色,使其被解释为文字(文本)而不是“代码”。 在Windows CMD.EXE中转义字符的最常用方法是在其前面添加一个^字符。 有时一个字符串被解析两次,这可能需要一个转义序列^^^ ,(当处理延迟扩展时,可能需要^^ ! )。 更多轮解析需要更多的^字符。 它很快就会变得混乱,需要练习才能掌握它。 但是你的情况完全不同 - 逃避无法解决。 你的FOR变量中有“代码”,你希望它被解释为这样。 但相反,它被解释为文本 ...
-
您的代码应该以这种形式工作,但原始输入函数返回一个字符串而不是一个数字... 所以你需要这样做: a=int(raw_input("Input number:")) You code should work in this form, but the raw input function returns a string and not a number... So you need to do this: a=int(raw_input("Input number:"))
-
1.调试批处理文件 为了调试批处理文件以查找代码中的语法错误,建议在修改每个echo off以echo ON或从批处理文件中删除或使用命令REM注释掉后,在命令提示符窗口中运行批处理文件。 默认情况下,Windows命令解释器在解析和预处理之后输出每个命令行或整个命令块(以匹配开头) ,其中%variable% (立即扩展)引用的环境变量已被环境变量的当前值替换执行命令行/块。 当@echo off在批处理文件的顶部@echo off时,此默认行为将被关闭,其中@在命令行的开头也禁用此第一个命令行的输出。 ...