lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jerry Li <zongjie...@gmail.com>
Subject Re: ArrayIndexOutOfBoundsException in sort
Date Wed, 01 Dec 2010 09:36:37 GMT
Hi

It seems work fine again after I change "author" field type from text to
string, could anybody give some info about it? very appriciated.

<field name="author" type="string" indexed="true" stored="true"
required="true" default=" "/>


On Wed, Dec 1, 2010 at 5:20 PM, Jerry Li <zongjielee@gmail.com> wrote:

> sorry for lost, following is my schema.xml config and I use IKTokenizer for
> Chinese charactor
>
>
>
>    <fieldType name="text" class="solr.TextField"
> positionIncrementGap="100">
>       <analyzer type="index">
>         <tokenizer class="org.wltea.analyzer.solr.IKTokenizerFactory"
> isMaxWordLength="false"/>
>         <!-- tokenizer class="solr.WhitespaceTokenizerFactory"/ -->
>         <!-- in this example, we will only use synonyms at query time
>         <filter class="solr.SynonymFilterFactory"
> synonyms="index_synonyms.txt" ignoreCase="true" expand="false"/>
>         -->
>         <!-- Case insensitive stop word removal.
>           add enablePositionIncrements=true in both the index and query
>           analyzers to leave a 'gap' for more accurate phrase queries.
>         -->
>         <filter class="solr.StopFilterFactory"
>                 ignoreCase="true"
>                 words="stopwords.txt"
>                 enablePositionIncrements="true"
>                 />
>         <filter class="solr.WordDelimiterFilterFactory"
> generateWordParts="1" generateNumberParts="1" catenateWords="1" catenateNumb
> ers="1" catenateAll="0" splitOnCaseChange="1"/>
>         <filter class="solr.LowerCaseFilterFactory"/>
>         <filter class="solr.SnowballPorterFilterFactory" language="English"
> protected="protwords.txt"/>
>       </analyzer>
>       <analyzer type="query">
>         <tokenizer class="org.wltea.analyzer.solr.IKTokenizerFactory"
> isMaxWordLength="true"/>
>         <!-- tokenizer class="solr.WhitespaceTokenizerFactory"/ -->
>         <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt"
> ignoreCase="true" expand="true"/>
>         <filter class="solr.StopFilterFactory"
>                 ignoreCase="true"
>                 words="stopwords.txt"
>                 enablePositionIncrements="true"
>                 />
>         <filter class="solr.WordDelimiterFilterFactory"
> generateWordParts="1" generateNumberParts="1" catenateWords="0" catenateNumb
> ers="0" catenateAll="0" splitOnCaseChange="1"/>
>         <filter class="solr.LowerCaseFilterFactory"/>
>         <filter class="solr.SnowballPorterFilterFactory" language="English"
> protected="protwords.txt"/>
>       </analyzer>
>     </fieldType>
>
>
>    <field name="id" type="string" indexed="true" stored="true"
> required="true" />
>    <field name="documentId" type="tlong" indexed="true" stored="true"
> required="true" />
>    <field name="headline" type="text" indexed="true" stored="true"
> omitNorms="true" required="true" />
>    <field name="content" type="text" indexed="true" stored="true"
> compressed="true" omitNorms="true" required="true" />
>    <field name="author" type="text" indexed="true" stored="true"
> required="true" default=" "/>
>    <field name="pubName" type="text" indexed="true" stored="true"
> required="true" default=" "/>
>    <field name="pubType" type="tint" indexed="true" stored="true"
> required="true" />
>    <field name="section" type="text" indexed="true" stored="true"
> required="true" />
>    <field name="column" type="text" indexed="true" stored="true"
> required="true" />
>    <field name="folderId" type="tint" indexed="true" stored="true"
> required="true"/>
>    <field name="userId" type="string" indexed="true" stored="true"
> required="true"/>
>    <field name="readType" type="tint" indexed="true" stored="true"
> required="true" />
>    <field name="downloadType" type="tint" indexed="true" stored="true"
> required="true" />
>    <field name="hasImg" type="tint" indexed="false" stored="true"
> required="true" />
>    <field name="hasText" type="tint" indexed="false" stored="true"
> required="true" />
>    <field name="pubDate" type="tint" indexed="true" stored="true"
> required="true"/>
>    <field name="trackingTime" type="tint" indexed="true" stored="true"
> required="true" />
>    <field name="text" type="text" indexed="true" stored="false"
> multiValued="true"/>
>
>
> <uniqueKey>id</uniqueKey>
>
> <defaultSearchField>text</defaultSearchField>
>
>    <copyField source="headline" dest="text"/>
>    <copyField source="content" dest="text"/>
>
>
>
> On Wed, Dec 1, 2010 at 2:50 PM, Gora Mohanty <gora@mimirtech.com> wrote:
>
>> On Wed, Dec 1, 2010 at 10:56 AM, Jerry Li <zongjielee@gmail.com> wrote:
>> > Hi team
>> >
>> > My solr version is 1.4
>> > There is an ArrayIndexOutOfBoundsException when i sort one field and the
>> > following is my code and log info,
>> > any help will be appreciated.
>> >
>> > Code:
>> >
>> >        SolrQuery query = new SolrQuery();
>> >        query.setSortField("author", ORDER.desc);
>> [...]
>>
>> Please show us how the field "author" defined in your
>> schema.xml. Sorting has to be done on a non-tokenized
>> field, e.g., a StrField.
>>
>> Regards,
>> Gora
>>
>
>
>
> --
>
> Best Regards.
> Jerry. Li | 李宗杰
> 
>



-- 

Best Regards.
Jerry. Li | 李宗杰


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message