Howdy,

I have a Solr implementation that allows me to do a geospatial search and
I'm trying to replicate it using the solrj libs. The schema.xml that I'm
using looks like this:
<schema name="v3_geo" version="1.1">
  <types>
    <fieldtype name="string"  class="solr.StrField" sortMissingLast="true"
omitNorms="true"/>
    <fieldType name="int" class="solr.TrieIntField" precisionStep="0"
positionIncrementGap="0"/>
    <fieldType name="float" class="solr.TrieFloatField" precisionStep="0"
positionIncrementGap="0"/>
    <fieldType name="long" class="solr.TrieLongField" precisionStep="0"
positionIncrementGap="0"/>
    <fieldType name="date" class="solr.TrieDateField" precisionStep="0"
positionIncrementGap="0"/>
    <fieldType name="tdouble" class="solr.TrieDoubleField" precisionStep="8"
omitNorms="true" positionIncrementGap="0"/>
    <fieldType name="location" class="solr.LatLonType"
subFieldSuffix="_coordinate"/>
    <fieldType name="text_en" class="solr.TextField"
positionIncrementGap="100">
      <analyzer type="index"> 
        <tokenizer class="solr.WhitespaceTokenizerFactory"/>
        <filter class="solr.LowerCaseFilterFactory"/> 
      </analyzer> 
      <analyzer type="query"> 
        <tokenizer class="solr.WhitespaceTokenizerFactory"/>
        <filter class="solr.LowerCaseFilterFactory"/> 
      </analyzer> 
    </fieldType>  
    <fieldType name="text_general" class="solr.TextField"
positionIncrementGap="100">
      <analyzer type="index">
        <tokenizer class="solr.WhitespaceTokenizerFactory"/>
        <filter class="solr.LowerCaseFilterFactory"/> 
      </analyzer>
      <analyzer type="query">
        <tokenizer class="solr.WhitespaceTokenizerFactory"/>
        <filter class="solr.LowerCaseFilterFactory"/> 
      </analyzer>
    </fieldType>
  </types>

 <fields>   
  
   <field name="id" type="string" indexed="true" stored="true"
required="true" /> 
   <field name="cid" type="long" indexed="true" stored="true"
required="true"/>
   <field name="lang" type="string" indexed="true" stored="true"
required="true"/>
   <field name="file_version" type="int" indexed="true" stored="true"
required="true"/>
   <field name="name" type="text_general" indexed="true" stored="true"
required="true"/>
   <field name="loc" type="location" indexed="true" stored="true"
required="true" />
   <field name="created" type="date" indexed="false" stored="true"/>
   <field name="last_modified" type="date" indexed="true" stored="true"/>
   <field name="version" type="long" indexed="true" stored="true"/>
   <field name="_version_" type="long" indexed="true" stored="true"
multiValued="false"/>
   <dynamicField name="*_coordinate" type="tdouble" indexed="true"
stored="false" multiValued="false" />
 </fields>
 
 
 <uniqueKey>id</uniqueKey>

 
 <defaultSearchField>name</defaultSearchField>

 
 <solrQueryParser defaultOperator="AND"/>
</schema>

And it works perfectly. Now I'm trying to write code to create an index
using the same fields. I have previously created other indexes just fine (by
creating an Analyzer and an IndexWriter and writing Document objects) and I
will be reusing the same Analyzer I used before. The problem specifically
lies in creating the field (a TrieDoubleField) for the lat/lon data. Is
there an example of that somewhere that I could plagiarize?

Regards,

Tim



--
View this message in context: 
http://lucene.472066.n3.nabble.com/Solrj-how-to-use-TrieDoubleField-tp4039083.html
Sent from the Solr - User mailing list archive at Nabble.com.

Reply via email to