Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/search/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/solr/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Search 1个字段:Autosuggest+;搜寻_Search_Solr_Typo3_Autosuggest - Fatal编程技术网

Search 1个字段:Autosuggest+;搜寻

Search 1个字段:Autosuggest+;搜寻,search,solr,typo3,autosuggest,Search,Solr,Typo3,Autosuggest,我有以下用例: 我想使用一个字段来进行autosuggest和带有“q”参数的全文搜索 现在的问题是:当我想进行全文搜索并选择“\u text”或“\u textM”作为类型时,那么全文搜索完全基于单词。 但由于solr中“*_textM”的标记化,当使用“Eid/Suggest”进行自动提示时,我只得到整个单词的1个小写部分。 例如,如果我将“这是一个值”索引为“\u text”,那么对于autosuggest,我只会得到“This”。作为autosuggest值,我需要的是“这是一个值” 解

我有以下用例: 我想使用一个字段来进行autosuggest和带有“q”参数的全文搜索 现在的问题是:当我想进行全文搜索并选择“\u text”或“\u textM”作为类型时,那么全文搜索完全基于单词。 但由于solr中“*_textM”的标记化,当使用“Eid/Suggest”进行自动提示时,我只得到整个单词的1个小写部分。 例如,如果我将“这是一个值”索引为“\u text”,那么对于autosuggest,我只会得到“This”。作为autosuggest值,我需要的是“这是一个值”


解决这个问题的最佳方法是什么?

如果您想在自动建议和搜索中使用相同的字段。然后,您可以使用不同的字段类型为该字段创建一个复制字段。例如,内容是要用于自动建议搜索的字段。
然后,您可以使用内容作为全文搜索,并为建议创建另一个字段内容_suggest,该字段是具有不同字段类型的内容的副本字段

<field name="content" type="_textS"  indexed="true" stored="true"/>
<field name="content_suggest" type="string"  indexed="true" stored="true"/>
<copyField source="content" dest="content_suggest"/>

好的。为什么在这个用例中使用“copyField”而不是“DocValues”