Updating Parent and Child Solr (5) Documents -
given have indexed parent document
along number of _childdocuments_
, correct way post update of parent
? understand need resubmit parent
along _childdocuments_
.
what having trouble create database record triggers call index item. (using laravel 5)
i associate additional data followed firing call reindex same item.
rather replacing existing solr document updated version, adds document same id index. <uniquekey>id</uniquekey>
correctly set in schema.xml
. notice different _version_
values.
do have delete parent
, _childdocuments_
before submitting revised document index?
note: running on version 5.3.0-2015-06-16_01-18-34 1685690 - jenkins - 2015-06-15 21:25:19
here schema.xml minus comments:
<?xml version="1.0" encoding="utf-8" ?> <schema name="example" version="1.5"> <field name="_version_" type="long" indexed="true" stored="true"/> <field name="_root_" type="string" indexed="true" stored="false"/> <field name="id" type="string" indexed="true" stored="true" required="true" multivalued="false" /> <dynamicfield name="*_i" type="int" indexed="true" stored="true"/> <dynamicfield name="*_is" type="int" indexed="true" stored="true" multivalued="true"/> <dynamicfield name="*_s" type="string" indexed="true" stored="true" /> <dynamicfield name="*_ss" type="string" indexed="true" stored="true" multivalued="true"/> <dynamicfield name="*_l" type="long" indexed="true" stored="true"/> <dynamicfield name="*_ls" type="long" indexed="true" stored="true" multivalued="true"/> <dynamicfield name="*_t" type="text_general" indexed="true" stored="true"/> <dynamicfield name="*_txt" type="text_general" indexed="true" stored="true" multivalued="true"/> <dynamicfield name="*_en" type="text_en" indexed="true" stored="true" multivalued="true"/> <dynamicfield name="*_b" type="boolean" indexed="true" stored="true"/> <dynamicfield name="*_bs" type="boolean" indexed="true" stored="true" multivalued="true"/> <dynamicfield name="*_f" type="float" indexed="true" stored="true"/> <dynamicfield name="*_fs" type="float" indexed="true" stored="true" multivalued="true"/> <dynamicfield name="*_d" type="double" indexed="true" stored="true"/> <dynamicfield name="*_ds" type="double" indexed="true" stored="true" multivalued="true"/> <dynamicfield name="*_coordinate" type="tdouble" indexed="true" stored="false" /> <dynamicfield name="*_dt" type="date" indexed="true" stored="true"/> <dynamicfield name="*_dts" type="date" indexed="true" stored="true" multivalued="true"/> <dynamicfield name="*_p" type="location" indexed="true" stored="true"/> <dynamicfield name="*_ti" type="tint" indexed="true" stored="true"/> <dynamicfield name="*_tl" type="tlong" indexed="true" stored="true"/> <dynamicfield name="*_tf" type="tfloat" indexed="true" stored="true"/> <dynamicfield name="*_td" type="tdouble" indexed="true" stored="true"/> <dynamicfield name="*_tdt" type="tdate" indexed="true" stored="true"/> <dynamicfield name="*_c" type="currency" indexed="true" stored="true"/> <dynamicfield name="ignored_*" type="ignored" multivalued="true"/> <dynamicfield name="attr_*" type="text_general" indexed="true" stored="true" multivalued="true"/> <dynamicfield name="random_*" type="random" /> <uniquekey>id</uniquekey> <fieldtype name="string" class="solr.strfield" sortmissinglast="true" /> <fieldtype name="boolean" class="solr.boolfield" sortmissinglast="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="double" class="solr.triedoublefield" precisionstep="0" positionincrementgap="0"/> <fieldtype name="tint" class="solr.trieintfield" precisionstep="8" positionincrementgap="0"/> <fieldtype name="tfloat" class="solr.triefloatfield" precisionstep="8" positionincrementgap="0"/> <fieldtype name="tlong" class="solr.trielongfield" precisionstep="8" positionincrementgap="0"/> <fieldtype name="tdouble" class="solr.triedoublefield" precisionstep="8" positionincrementgap="0"/> <fieldtype name="date" class="solr.triedatefield" precisionstep="0" positionincrementgap="0"/> <fieldtype name="tdate" class="solr.triedatefield" precisionstep="6" positionincrementgap="0"/> <fieldtype name="binary" class="solr.binaryfield"/> <fieldtype name="random" class="solr.randomsortfield" indexed="true" /> <fieldtype name="text_ws" class="solr.textfield" positionincrementgap="100"> <analyzer> <tokenizer class="solr.whitespacetokenizerfactory"/> </analyzer> </fieldtype> <fieldtype name="text_general" class="solr.textfield" positionincrementgap="100"> <analyzer type="index"> <tokenizer class="solr.standardtokenizerfactory"/> <filter class="solr.stopfilterfactory" ignorecase="true" words="stopwords.txt" /> <filter class="solr.lowercasefilterfactory"/> </analyzer> <analyzer type="query"> <tokenizer class="solr.standardtokenizerfactory"/> <filter class="solr.stopfilterfactory" ignorecase="true" words="stopwords.txt" /> <filter class="solr.synonymfilterfactory" synonyms="synonyms.txt" ignorecase="true" expand="true"/> <filter class="solr.lowercasefilterfactory"/> </analyzer> </fieldtype> <fieldtype name="text_en" class="solr.textfield" positionincrementgap="100"> <analyzer type="index"> <tokenizer class="solr.standardtokenizerfactory"/> <filter class="solr.stopfilterfactory" ignorecase="true" words="lang/stopwords_en.txt" /> <filter class="solr.lowercasefilterfactory"/> <filter class="solr.englishpossessivefilterfactory"/> <filter class="solr.keywordmarkerfilterfactory" protected="protwords.txt"/> <filter class="solr.porterstemfilterfactory"/> </analyzer> <analyzer type="query"> <tokenizer class="solr.standardtokenizerfactory"/> <filter class="solr.synonymfilterfactory" synonyms="synonyms.txt" ignorecase="true" expand="true"/> <filter class="solr.stopfilterfactory" ignorecase="true" words="lang/stopwords_en.txt" /> <filter class="solr.lowercasefilterfactory"/> <filter class="solr.englishpossessivefilterfactory"/> <filter class="solr.keywordmarkerfilterfactory" protected="protwords.txt"/> <filter class="solr.porterstemfilterfactory"/> </analyzer> </fieldtype> <fieldtype name="text_en_splitting" class="solr.textfield" positionincrementgap="100" autogeneratephrasequeries="true"> <analyzer type="index"> <tokenizer class="solr.whitespacetokenizerfactory"/> <filter class="solr.stopfilterfactory" ignorecase="true" words="lang/stopwords_en.txt" /> <filter class="solr.worddelimiterfilterfactory" generatewordparts="1" generatenumberparts="1" catenatewords="1" catenatenumbers="1" catenateall="0" splitoncasechange="1"/> <filter class="solr.lowercasefilterfactory"/> <filter class="solr.keywordmarkerfilterfactory" protected="protwords.txt"/> <filter class="solr.porterstemfilterfactory"/> </analyzer> <analyzer type="query"> <tokenizer class="solr.whitespacetokenizerfactory"/> <filter class="solr.synonymfilterfactory" synonyms="synonyms.txt" ignorecase="true" expand="true"/> <filter class="solr.stopfilterfactory" ignorecase="true" words="lang/stopwords_en.txt" /> <filter class="solr.worddelimiterfilterfactory" generatewordparts="1" generatenumberparts="1" catenatewords="0" catenatenumbers="0" catenateall="0" splitoncasechange="1"/> <filter class="solr.lowercasefilterfactory"/> <filter class="solr.keywordmarkerfilterfactory" protected="protwords.txt"/> <filter class="solr.porterstemfilterfactory"/> </analyzer> </fieldtype> <fieldtype name="text_en_splitting_tight" class="solr.textfield" positionincrementgap="100" autogeneratephrasequeries="true"> <analyzer> <tokenizer class="solr.whitespacetokenizerfactory"/> <filter class="solr.synonymfilterfactory" synonyms="synonyms.txt" ignorecase="true" expand="false"/> <filter class="solr.stopfilterfactory" ignorecase="true" words="lang/stopwords_en.txt"/> <filter class="solr.worddelimiterfilterfactory" generatewordparts="0" generatenumberparts="0" catenatewords="1" catenatenumbers="1" catenateall="0"/> <filter class="solr.lowercasefilterfactory"/> <filter class="solr.keywordmarkerfilterfactory" protected="protwords.txt"/> <filter class="solr.englishminimalstemfilterfactory"/> <filter class="solr.removeduplicatestokenfilterfactory"/> </analyzer> </fieldtype> <fieldtype name="text_general_rev" class="solr.textfield" positionincrementgap="100"> <analyzer type="index"> <tokenizer class="solr.standardtokenizerfactory"/> <filter class="solr.stopfilterfactory" ignorecase="true" words="stopwords.txt" /> <filter class="solr.lowercasefilterfactory"/> <filter class="solr.reversedwildcardfilterfactory" withoriginal="true" maxposasterisk="3" maxposquestion="2" maxfractionasterisk="0.33"/> </analyzer> <analyzer type="query"> <tokenizer class="solr.standardtokenizerfactory"/> <filter class="solr.synonymfilterfactory" synonyms="synonyms.txt" ignorecase="true" expand="true"/> <filter class="solr.stopfilterfactory" ignorecase="true" words="stopwords.txt" /> <filter class="solr.lowercasefilterfactory"/> </analyzer> </fieldtype> <fieldtype name="alphaonlysort" class="solr.textfield" sortmissinglast="true" omitnorms="true"> <analyzer> <tokenizer class="solr.keywordtokenizerfactory"/> <filter class="solr.lowercasefilterfactory" /> <filter class="solr.trimfilterfactory" /> <filter class="solr.patternreplacefilterfactory" pattern="([^a-z])" replacement="" replace="all" /> </analyzer> </fieldtype> <fieldtype name="lowercase" class="solr.textfield" positionincrementgap="100"> <analyzer> <tokenizer class="solr.keywordtokenizerfactory"/> <filter class="solr.lowercasefilterfactory" /> </analyzer> </fieldtype> <fieldtype name="ignored" stored="false" indexed="false" multivalued="true" class="solr.strfield" /> <fieldtype name="point" class="solr.pointtype" dimension="2" subfieldsuffix="_d"/> <fieldtype name="location" class="solr.latlontype" subfieldsuffix="_coordinate"/> <fieldtype name="location_rpt" class="solr.spatialrecursiveprefixtreefieldtype" geo="true" disterrpct="0.025" maxdisterr="0.001" distanceunits="kilometers" /> <fieldtype name="bbox" class="solr.bboxfield" geo="true" distanceunits="kilometers" numbertype="_bbox_coord" /> <fieldtype name="_bbox_coord" class="solr.triedoublefield" precisionstep="8" docvalues="true" stored="false"/> <fieldtype name="currency" class="solr.currencyfield" precisionstep="8" defaultcurrency="usd" currencyconfig="currency.xml" /> <fields> <field name="amount" type="string" indexed="true" stored="true" multivalued="false" /> <field name="area" type="string" indexed="true" stored="true" multivalued="false" /> <field name="attempted_at" type="date" indexed="true" stored="true" multivalued="false" /> <field name="attempted_count" type="int" indexed="true" stored="true" multivalued="false" /> <field name="attempted_how" type="string" indexed="true" stored="true" multivalued="false" /> <field name="attempted_dates" type="string" indexed="true" stored="true" multivalued="true" /> <field name="block" type="string" indexed="true" stored="true" multivalued="false" /> <field name="body" type="string" indexed="true" stored="true" multivalued="false" /> <field name="building" type="string" indexed="true" stored="true" multivalued="false" /> <field name="city" type="string" indexed="true" stored="true" multivalued="false" /> <field name="community" type="string" indexed="true" stored="true" multivalued="false" /> <field name="condominium" type="string" indexed="true" stored="true" multivalued="false" /> <field name="contacted" type="boolean" indexed="true" stored="true" multivalued="false" /> <field name="contacted_at" type="date" indexed="true" stored="true" multivalued="false" /> <field name="contacted_by" type="string" indexed="true" stored="true" multivalued="true" /> <field name="contacted_how" type="string" indexed="true" stored="true" multivalued="false" /> <field name="contacts" type="string" indexed="true" stored="true" multivalued="true" /> <field name="continent" type="string" indexed="true" stored="true" multivalued="true" /> <field name="country" type="string" indexed="true" stored="true" multivalued="false" /> <field name="created_at" type="date" indexed="true" stored="true" multivalued="false" /> <field name="date_at" type="date" indexed="true" stored="true" multivalued="false" /> <field name="description" type="string" indexed="true" stored="true" multivalued="false" /> <field name="directions" type="text_en_splitting" indexed="true" stored="true" multivalued="true" /> <field name="doc_type" type="string" indexed="true" stored="true" required="true"/> <field name="feature_age" type="string" indexed="true" stored="true" multivalued="false" /> <field name="feature_color" type="string" indexed="true" stored="true" multivalued="false" /> <field name="feature_feature" type="string" indexed="true" stored="true" multivalued="false" /> <field name="feature_madeof" type="string" indexed="true" stored="true" multivalued="false" /> <field name="floor" type="string" indexed="true" stored="true" multivalued="false" /> <field name="geo_parent_id" type="long" indexed="true" stored="true" multivalued="false" /> <field name="gmt" type="int" indexed="true" stored="true" multivalued="false" /> <field name="initials" type="string" indexed="true" stored="true" multivalued="false" /> <field name="json" type="string" indexed="false" stored="true" multivalued="false" /> <field name="key" type="string" indexed="false" stored="true" multivalued="false" /> <field name="lang_id" type="long" indexed="true" stored="true" multivalued="false" /> <field name="lang_keys" type="string" indexed="true" stored="true" multivalued="true" /> <field name="lang_mother_keys" type="string" indexed="true" stored="true" multivalued="true" /> <field name="latlon" type="location" indexed="true" stored="true" multivalued="false" /> <field name="level" type="int" indexed="true" stored="true" multivalued="false" /> <field name="name" type="string" indexed="true" stored="true" multivalued="false" /> <field name="nameinformal" type="string" indexed="true" stored="true" multivalued="false" /> <field name="neighborhood" type="string" indexed="true" stored="true" multivalued="false" /> <field name="owner_id" type="long" indexed="true" stored="true" multivalued="false" /> <field name="parent_id" type="long" indexed="true" stored="true" multivalued="false" /> <field name="par_key" type="string" indexed="true" stored="true" multivalued="false" /> <field name="path" type="string" indexed="true" stored="true" multivalued="false" /> <field name="publish" type="boolean" indexed="true" stored="true" multivalued="false" /> <field name="publisher_initials" type="boolean" indexed="true" stored="true" multivalued="false" /> <field name="region" type="string" indexed="true" stored="true" multivalued="false" /> <field name="section" type="string" indexed="true" stored="true" multivalued="false" /> <field name="slug" type="string" indexed="true" stored="true" multivalued="false" /> <field name="status" type="string" indexed="true" stored="true" multivalued="false" /> <field name="subject" type="string" indexed="true" stored="true" multivalued="false" /> <field name="terrname" type="string" indexed="true" stored="true" multivalued="false" /> <field name="terrnameinformal" type="string" indexed="true" stored="true" multivalued="false" /> <field name="text" type="text_general" indexed="true" stored="true" multivalued="true" /> <field name="town" type="string" indexed="true" stored="true" multivalued="false" /> <field name="type" type="string" indexed="true" stored="true" multivalued="false" /> <field name="uid" type="string" indexed="false" stored="true" multivalued="false" /> <field name="updated_at" type="date" indexed="true" stored="true" multivalued="false" /> <field name="url" type="string" indexed="false" stored="true" multivalued="false" /> <field name="weight" type="int" indexed="true" stored="true" multivalued="false" /> <field name="zip" type="string" indexed="true" stored="true" multivalued="false" /> </fields> <uniquekey>id</uniquekey> <defaultsearchfield>text</defaultsearchfield> <copyfield source="area" dest="text"/> <copyfield source="body" dest="text"/> <copyfield source="building" dest="text"/> <copyfield source="city" dest="text"/> <copyfield source="condominium" dest="text"/> <copyfield source="continent" dest="text"/> <copyfield source="country" dest="text"/> <copyfield source="description" dest="text"/> <copyfield source="directions" dest="text"/> <copyfield source="feature_age" dest="text"/> <copyfield source="feature_color" dest="text"/> <copyfield source="feature_madeof" dest="text"/> <copyfield source="initials" dest="text"/> <copyfield source="name" dest="text"/> <copyfield source="nameinformal" dest="text"/> <copyfield source="neighborhood" dest="text"/> <copyfield source="publisher_initials" dest="text"/> <copyfield source="region" dest="text"/> <copyfield source="section" dest="text"/> <copyfield source="slug" dest="text"/> <copyfield source="subject" dest="text"/> <copyfield source="terrname" dest="text"/> <copyfield source="terrnameinformal" dest="text"/> <copyfield source="town" dest="text"/> <copyfield source="uid" dest="text"/> <copyfield source="url" dest="text"/> <copyfield source="zip" dest="text"/> </schema>
Comments
Post a Comment