Solr 3.6.1 を使用しています。整数値を含むSolrソートフィールドに使用する正しいフィールドタイプは何ですか? このフィールドは並べ替えにのみ必要であり、範囲クエリを実行することはありません。またはを使用する必要がありますinteger
かsint
?
schema.xml には、次のようにsint
宣言された型 があることがわかります。
<!-- Numeric field types that manipulate the value into
a string value that isn't human-readable in its internal form,
but with a lexicographic ordering the same as the numeric ordering,
so that range queries work correctly. -->
<fieldType name="sint" class="solr.SortableIntField" sortMissingLast="true" omitNorms="true"/>
一方integer
、次のように述べています。
<!-- numeric field types that store and index the text
value verbatim (and hence don't support range queries, since the
lexicographic ordering isn't equal to the numeric ordering) -->
<fieldType name="integer" class="solr.IntField" omitNorms="true"/>
私がこれを尋ねている主な理由は、フィールドで実行するすべての Solr ソートsint
(動的フィールドとして宣言されているものをたくさん持っています) が (構成不可能な) lucene fieldCache にデータを入力するためです。フィールドキャッシュの下の統計ページ (http://HOST:PORT/solr/CORE/admin/stats.jsp) で、並べsint
替えが次のように保存されていることがわかります。
org.apache.lucene.search.FieldCache$StringIndex
一方、integer
並べ替えは次のように保存されます
org.apache.lucene.search.FieldCache.DEFAULT_INT_PARSER
どちらがより少ないスペースを消費すると思いますか?
更新: Solr 3.6.1 schema.xml はie as としてint
宣言されていますTrieIntField
<fieldType name="int" class="solr.TrieIntField" precisionStep="0" positionIncrementGap="0"/>
上記のものは、古い solr バージョンのものです。