Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Solr error 500 on phrasequery search for text_general field

Tags:

solr

phrase

getting query error on :

LNm:"PersonLastName III"

Response is: "field \"LNm\" was indexed without position data; cannot run PhraseQuery'

Schema is:

<field name="LNm" type="text_general" indexed="true" stored="true"/>

<fieldType name="text_general" class="solr.TextField" positionIncrementGap="100">
    <analyzer type="index">
        <tokenizer class="solr.StandardTokenizerFactory"/>
        <filter class="solr.LowerCaseFilterFactory"/>
    </analyzer>

    <analyzer type="query">
        <tokenizer class="solr.StandardTokenizerFactory"/>
        <filter class="solr.LowerCaseFilterFactory"/>
    </analyzer>
</fieldType>
like image 820
p1vande Avatar asked Oct 24 '13 19:10

p1vande


1 Answers

This is because you changed field_type from string to text_general and didn't do a clean index. So indexer doesn't have necessary position data. First empty your core using

/your_core_name/update?stream.body=<delete><query>*:*</query></delete>&commit=true

then index this core.

Attention: the update code above will delete all your data in core and this cannot be undone!

like image 166
Can YILDIZ Avatar answered Sep 30 '22 18:09

Can YILDIZ