【发布时间】:2017-07-28 09:37:04
【问题描述】:
我用这种格式将维基百科转储文件索引到 solr:
<page>
<title>Bruce Willis</title>
<ns>0</ns>
<id>64673</id>
<revision>
<id>789709463</id>
<parentid>789690745</parentid>
<timestamp>2017-07-09T02:27:39Z</timestamp>
<contributor>
<username>Materialscientist</username>
<id>7852030</id>
</contributor>
<comment>imdb is not a reliable source</comment>
<model>wikitext</model>
<format>text/x-wiki</format>
<text xml:space="preserve" bytes="57375">{{Use mdy dates|date=March 2012}}
{{Infobox person
| name = Bruce Willis
| image = Bruce Willis by Gage Skidmore.jpg
| caption = Willis at the 2010 [[San Diego Comic-Con]].
| birth_name = Walter Bruce Willis
| birth_date = {{Birth date and age|1955|3|19}}
|
| birth_place = [[Idar-Oberstein]], West Germany
| nationality = [[American people|American]]
| residence = [[Los Angeles]], [[California]], U.S.
以及核心的架构文件:
<fieldType name="string" class="solr.StrField"/>
<fieldType name="date" class="solr.TrieDateField" precisionStep="0" positionIncrementGap="0"/>
<fieldType name="int" class="solr.TrieIntField" precisionStep="0" positionIncrementGap="0"/>
<fieldType name="float" class="solr.TrieFloatField" precisionStep="0" positionIncrementGap="0"/>
<fieldType name="long" class="solr.TrieLongField" precisionStep="0" positionIncrementGap="0"/>
<fieldType name="double" class="solr.TrieDoubleField" precisionStep="0" positionIncrementGap="0"/>
<field name="id" type="string" indexed="true" stored="true" required="true"/>
<field name="_version_" type="long" indexed="true" stored="true"/>
<field name="TITLE" type="text_wiki" indexed="true" stored="true" termVectors="true" termPositions="true" termOffsets="true" />
<field name="REVISION_TEXT" type="text_wiki" indexed="true" stored="true" multiValued="true" termVectors="true" termPositions="true" termOffsets="true" />
<field name="REVISION_TIMESTAMP" type="date" indexed="true" stored="true" multiValued="true" />
<field name="CONTRIBUTOR_ID" type="int" indexed="true" stored="true" multiValued="true" />
<field name="CONTRIBUTOR_USERNAME" type="string" indexed="true" docValues="true" stored="true" multiValued="true" />
<dynamicField name="*" type="string" indexed="true" stored="true" multiValued="true"/>
<uniqueKey>id</uniqueKey>
我没有发布 schema.xml 的所有内容。我知道我们可以使用 solr 来获得分数或相似度。相似度的计算基于 (freq * (k1 + 1)) / (freq + k1 * (1 - b + b * fieldLength / avgFieldLength))。我认为页面排名是基于传入和传出页面的数量。但是使用这个 typeField 我无法检索传入和传出页面。
所以我不知道如何使用 solr 计算 pagerank。我理解错了吗?如果你知道怎么做,你能给我一些建议吗?谢谢
【问题讨论】: