我使用4.6.0。认为它是一个伟大的搜索引擎我有麻烦使我的lengthNorm顺序得分doc字段中的短字。
1。术语Im serching是“柠檬”。
2。我想在“名称”字段中为较少的单词评分
3. 结果2首批产品是:
{
"responseHeader": {
"status": 0,
"QTime": 0,
"params": {
"lowercaseOperators": "true",
"fl": "name,score",
"indent": "true",
"q": "lemon",
"qf": "name",
"_": "1457866062982",
"stopwords": "true",
"wt": "json",
"defType": "edismax",
"rows": "2"
}
},
"response": {
"numFound": 350,
"start": 0,
"maxScore": 2.6099632,
"docs": [
{
"name": "Fairway Lemon Fruit Slices",
"score": 2.6099632
},
{
"name": "Fairway Lemon Heads",
"score": 2.6099632
}
]
}
}
你可以看到我的问题是我希望第二个有三个单词的产品得分高于第一个有四个单词的人
4. 我试图在schema.xml中为字段类型省略Name =“false” 这是我在schema.xml中的行:
<!-- like text_en_splitting but indexing stop words and indexing synonyms -->
<fieldType name="text_en_splitting_unblocked" class="solr.TextField" positionIncrementGap="100" autoGeneratePhraseQueries="true" omitNorms="false">
<analyzer type="index">
<charFilter class="solr.MappingCharFilterFactory" mapping="mapping-ISOLatin1Accent.txt"/>
<!-- charFilter class="solr.MappingCharFilterFactory" mapping="mapping-FoldToASCII.txt"/ -->
<tokenizer class="solr.WhitespaceTokenizerFactory"/>
<!--- filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords_en.txt" enablePositionIncrements="false"/-->
<filter class="solr.SynonymFilterFactory" synonyms="index_synonyms.txt" ignoreCase="true" expand="false"/><!-- try expand="true" -->
<filter class="solr.WordDelimiterFilterFactory" generateWordParts="1" generateNumberParts="1" catenateWords="1" catenateNumbers="1" catenateAll="0" splitOnCaseChange="1"/>
<filter class="solr.LowerCaseFilterFactory"/>
<filter class="solr.KeywordMarkerFilterFactory" protected="protwords.txt"/>
<filter class="solr.PorterStemFilterFactory"/>
</analyzer>
<analyzer type="query">
<charFilter class="solr.MappingCharFilterFactory" mapping="mapping-ISOLatin1Accent.txt"/>
<!-- charFilter class="solr.MappingCharFilterFactory" mapping="mapping-FoldToASCII.txt"/ -->
<tokenizer class="solr.WhitespaceTokenizerFactory"/>
<!-- filter class="solr.SynonymFilterFactory" synonyms="index_synonyms.txt" ignoreCase="true" expand="false"/ --><!-- try expand="true" -->
<filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords_en.txt" enablePositionIncrements="true"/><!-- was false -->
<filter class="solr.WordDelimiterFilterFactory" catenateWords="1" preserveOriginal="1"/>
<filter class="solr.LowerCaseFilterFactory"/>
<filter class="solr.KeywordMarkerFilterFactory" protected="protwords.txt"/>
<filter class="solr.PorterStemFilterFactory"/>
</analyzer>
</fieldType>
并且:
<field name="name" type="text_en_splitting_unblocked" indexed="true" stored="true" />
尝试了stored =“true”或者存储=“false”
注意到架构浏览器中没有任何改变
http://127.0.0.1:8983/solr/#/collection1/schema-browser?field=name
名称仍然存储在所有名称中
属性
架构
指数
(对所有人都是V)
索引分析器: org.apache.solr.analysis.TokenizerChain 查询分析器: org.apache.solr.analysis.TokenizerChain
我试过重新索引并做了“service solr restart” 但仍然得分保持不变。 也许得分是相同的,因为在标记化之后检查更短的字段? 如果是这样,我该如何改变呢? 请帮帮我