私はSolr 3.6.1を使用しています。整数値を含むSolrソートフィールドに使用する正しいフィールドタイプは何ですか?私はソートのためだけにこのフィールドが必要で、その上でレンジ・クエリーを実行しません。 integer
またはsint
を使用する必要がありますか?私はこれを求めています主な理由は、すべてのSolrのため 整数値のソートに使用する正しいSolr fieldTypeは何ですか?
<!-- 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"/>
です
:<!-- 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
一方には、次の言葉:として
私はschema.xmlをして、宣言sint
タイプがあることがわかり私はsint
フィールド(私はそれらの多くが動的なフィールドとして宣言している)で行います(設定不可能な)lucene fieldCacheに値を設定します。 integer
ソートが
sint
種類が
org.apache.lucene.search.FieldCache$StringIndex
として格納されていることをfieldCache下(PORT/Solrの/ CORE /管理/ stats.jsp:// HOST HTTP)私は統計ページに表示します
org.apache.lucene.search.FieldCache.DEFAULT_INT_PARSER
私は少ないスペースを消費すると思いますか?
UPDATE:int
は、上記のいずれかが古いSolrのバージョンからのものであった
<fieldType name="int" class="solr.TrieIntField" precisionStep="0" positionIncrementGap="0"/>
としてTrieIntField
即ちとしてのSolr 3.6.1のschema.xmlを宣言しました。
IntFieldおよびSortableIntFieldの代わりに常にTrieIntFieldを使用する必要があります。このクラスは、メモリ効率の高いFieldCache impl – jpountz