Re: sint in schema.xml

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: sint in schema.xml

Bradley Burke
U
------Original Message------
From: sanraj25
To: [hidden email]
ReplyTo: [hidden email]
Sent: Oct 9, 2008 10:13 PM
Subject: Re: sint in schema.xml


Hi,
      I create own field name using integer field type and sint field
type(solr.SortableIntField) in schema.xml.
i can't differentiate between these two field type. When this sint exactly
use? If we use sint how it is sortable?



sanraj25 wrote:

>
> Hi,
>       I create own field name using integer field type and sint field
> type(solr.SortableIntField) in schema.xml.
> i can't differentiate between these two field type. When this sint exactly
> use? If we use sint how it is sortable? I test by {sort =field name} in
> query window .but it's not work properly.please tell me with clear example
> thanks in advance
>
> -sanraj
>
>

--
View this message in context: http://www.nabble.com/sint-in-schema.xml-tp19900303p19911165.html
Sent from the Solr - User mailing list archive at Nabble.com.



Sent via BlackBerry by AT&T
Reply | Threaded
Open this post in threaded view
|

Re: sint in schema.xml

pakore
In lucene, all the data is stored as strings, so if you have a field
defined as integer or sint, in lucene are strings, and if you try to
sort numbers represented as strings what happens is this:

example numbers: 1,2,3,4,5,6,7,8,9,10,11,12,13.
ordered as strings:    1,10,11,12,13,2,3,4,5,6,7,8,9

That's why there is a field type called sint, that means sortable int.
Is the same as int with the difference that it will order the numbers
properly.

example numbers: 1,2,3,4,5,6,7,8,9,10,11,12,13.
order being int:    1,10,11,12,13,2,3,4,5,6,7,8,9
order being sint:  1,2,3,4,5,6,7,8,9,10,11,12,13.

Pako

[hidden email] wrote:

> U
> ------Original Message------
> From: sanraj25
> To: [hidden email]
> ReplyTo: [hidden email]
> Sent: Oct 9, 2008 10:13 PM
> Subject: Re: sint in schema.xml
>
>
> Hi,
>       I create own field name using integer field type and sint field
> type(solr.SortableIntField) in schema.xml.
> i can't differentiate between these two field type. When this sint exactly
> use? If we use sint how it is sortable?
>
>
>
> sanraj25 wrote:
>  
>> Hi,
>>       I create own field name using integer field type and sint field
>> type(solr.SortableIntField) in schema.xml.
>> i can't differentiate between these two field type. When this sint exactly
>> use? If we use sint how it is sortable? I test by {sort =field name} in
>> query window .but it's not work properly.please tell me with clear example
>> thanks in advance
>>
>> -sanraj
>>
>>
>>    
>
>  

Reply | Threaded
Open this post in threaded view
|

Re: sint in schema.xml

hossman

: as integer or sint, in lucene are strings, and if you try to sort numbers
: represented as strings what happens is this:

Field sorting in Solr on both IntField and SortableIntField should work
becuase they both use the 'integer' FieldCache under the covers -- but
where you'll really see a difference is in Range Queries (it's
admittedly a slightly confusing aspect of hte name, but it's spelled
out fairly well in the example schema.xml) ...

    <!-- 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"/>

: > > use? If we use sint how it is sortable? I test by {sort =field name} in
: > > query window .but it's not work properly.please tell me with clear example
: > > thanks in advance

can you elaborate on what exactly you have tried, and what you mean by
"it's not work properly" ?


-Hoss