Sorry for the double post. Formatting got lost too :(

Whenever I mention the field "type" I actually mean "type_s".


-----Ursprüngliche Nachricht-----
Von: Sebastian Riemer [mailto:s.rie...@littera.eu] 
Gesendet: Dienstag, 10. Mai 2016 11:47
An: solr-user@lucene.apache.org
Betreff: How to find out if index contains orphaned child documents

Hi all,



I have the suspicion that my index might contain orphaned child documents 
because a query restricting to a field on a child document field returns two 
parent documents where I only expect one document to match the query. As I 
cannot figure out any obvious reason why the second document is returned, I 
suspect something is going wrong elsewhere. (See the query link and the result 
in very small font at the end of mail).



Therefore I would like to know whether there is a simple way to find out if my 
index contains orphaned child documents?



In my index I have parent documents which are marked through field 
"type_s:wemi" and I have child documents (amongst other) marked through field 
"type:cat_title". They share the same ID in a field called "wemiId”.



So I guess I would have to phrase a query like “are there any documents with a 
type_s other than wemi for which there are no documents with type wemi having 
the same wemiId?”



If you need further information I am happy to provide, thanks for your help!



Sebastian





Query in multiple formats:



http://localhost:8983/solr/wemi/select?q=*:*&fq=client_id:1&fq=cat_db_id:4294967297&fq=m_id_l:[*
 TO *]&fq=(type_s:wemi AND {!parent which='type_s:wemi'v='(((type_s:cat_title 
AND titles_name_t_ns:("Neuland unter den 
Sandalen"))))'})&start=0&rows=15&wt=json&indent=true



http://localhost:8983/solr/wemi/select?q=*%3A*&fq=client_id%3A1&fq=cat_db_id%3A4294967297&fq=m_id_l%3A%5B*+TO+*%5D&fq=(type_s%3Awemi+AND+%7B!parent+which%3D%27type_s%3Awemi%27v%3D%27(((type_s%3Acat_title+AND+titles_name_t_ns%3A(%22Neuland+unter+den+Sandalen%22))))%27%7D)&start=0&rows=15&wt=json&indent=true



start=0

&rows=15

&fq=client_id:1

&fq=cat_db_id:4294967297

&fq=m_id_l:[* TO *]

&fq=(type_s:wemi AND {!parent which='type_s:wemi'v='(((type_s:cat_title AND 
titles_name_t_ns:("Neuland unter den Sandalen"))))'})

&q=*:*

&facet=true

&facet.missing=true

&facet.mincount=1

&group=true

&group.facet=true

&group.ngroups=true

&group.field=m_id_l

&sort=m_id_l desc

&facet.field={!ex=m_mt_0 key=m_mt_0}m_mediaType_lang_2_s



Result of the query:

(to verify that the result is strange, look for the text “Neuland unter den 
Sandalen”, which seems to only occur in one of the two documents)



{

  "responseHeader":{

    "status":0,

    "QTime":15,

    "params":{

      "q":"*:*",

      "indent":"true",

      "start":"0",

      "fq":["client_id:1",

        "cat_db_id:4294967297",

        "m_id_l:[* TO *]",

        "(type_s:wemi AND {!parent which='type_s:wemi'v='(((type_s:cat_title 
AND titles_name_t_ns:(\"Neuland unter den Sandalen\"))))'})"],

      "rows":"15",

      "wt":"json"}},

  "response":{"numFound":2,"start":0,"docs":[

      {

        "type_s":"wemi",

        "text":["wemi",

          "4294985955",

          "Work",

          "Werk",

          "Opera",

          "",

          "",

          "Neuland unter den Sandalen ; Müller, Christoph",

          "Müller, Christoph",

          "Neuland unter den Sandalen",

          "4294984086",

          "Neuland unter den Sandalen",

          "Expression",

          "Expression",

          "Espressione",

          "",

          "",

          "Neuland unter den Sandalen",

          "German",

          "Deutsch",

          "Tedesco",

          "German",

          "German",

          "TEXT",

          "4294985990",

          "Neuland unter den Sandalen ; Müller, Christoph",

          "Neuland unter den Sandalen",

          "Book",

          "Buch",

          "Libro",

          "",

          "",

          "Müller, Christoph",

          "Verlagsangaben Angaben aus der Verlagsmeldung \n\n \n\n  Bete, 
arbeite und brich auf! : Ein Benediktiner auf dem Jakobsweg / von Christoph 
Müller \n\n \nWas ein Ordensmann auf dem Jakobsweg erlebt: \nZum \"Ora et 
Labora\" gesellt sich bei Benediktinerpater Christoph das Pilgern hinzu. 
Zunächst per Fahrrad, später auf Schusters Rappen, erlebt er Freud- und 
Leidvolles bis Santiago. Gute Beobachtungsgabe, Sinn für Situationskomik und 
die benediktinische Spiritualität, die immer wieder durchscheint, machen diesen 
Pilgerbericht zu einem niveauvollen Leseerlebnis.",

          "1",

          "UNSPECIFIED",

          "Christoph Müller",

          "UNMEDIATED",

          "Ill., Kt.",

          "German",

          "Deutsch",

          "Tedesco",

          "German",

          "German",

          "205 S.",

          "4294985812",

          "4294985990",

          "4294967297",

          "2016-05-10T00:00:00Z",

          "Mü",

          "18449",

          "false",

          "1",

          "Available",

          "Verfügbar",

          "Disponibile",

          "",

          "",

          "true",

          "http://";],

        "wemiId":"4294985955429498408642949859904294985812",

        "id":"4294985955429498408642949859904294985812",

        "w_id_l":4294985955,

        "w_mediaType_lang_1_s":"Work",

        "w_mediaType_lang_2_s":"Werk",

        "w_mediaType_lang_3_s":"Opera",

        "w_mediaType_lang_4_s":"",

        "w_mediaType_lang_5_s":"",

        "w_displayTitle_s":"Neuland unter den Sandalen ; Müller, Christoph",

        "w_mainAuthority_s":"Müller, Christoph",

        "w_title_s":"Neuland unter den Sandalen",

        "e_id_l":4294984086,

        "e_displayTitle_s":"Neuland unter den Sandalen",

        "e_mediaType_lang_1_s":"Expression",

        "e_mediaType_lang_2_s":"Expression",

        "e_mediaType_lang_3_s":"Espressione",

        "e_mediaType_lang_4_s":"",

        "e_mediaType_lang_5_s":"",

        "e_title_s":"Neuland unter den Sandalen",

        "e_pt_16_lang_1_ss_ns":["German"],

        "e_pt_16_lang_2_ss_ns":["Deutsch"],

        "e_pt_16_lang_3_ss_ns":["Tedesco"],

        "e_pt_16_lang_4_ss_ns":["German"],

        "e_pt_16_lang_5_ss_ns":["German"],

        "e_pt_69_ss_ns":["TEXT"],

        "m_id_l":4294985990,

        "m_displayTitle_s":"Neuland unter den Sandalen ; Müller, Christoph",

        "m_title_s":"Neuland unter den Sandalen",

        "m_mediaType_lang_1_s":"Book",

        "m_mediaType_lang_2_s":"Buch",

        "m_mediaType_lang_3_s":"Libro",

        "m_mediaType_lang_4_s":"",

        "m_mediaType_lang_5_s":"",

        "m_mainAuthority_s":"Müller, Christoph",

        "m_annotations_ts_ns":["Verlagsangaben Angaben aus der Verlagsmeldung 
\n\n \n\n  Bete, arbeite und brich auf! : Ein Benediktiner auf dem Jakobsweg / 
von Christoph Müller \n\n \nWas ein Ordensmann auf dem Jakobsweg erlebt: \nZum 
\"Ora et Labora\" gesellt sich bei Benediktinerpater Christoph das Pilgern 
hinzu. Zunächst per Fahrrad, später auf Schusters Rappen, erlebt er Freud- und 
Leidvolles bis Santiago. Gute Beobachtungsgabe, Sinn für Situationskomik und 
die benediktinische Spiritualität, die immer wieder durchscheint, machen diesen 
Pilgerbericht zu einem niveauvollen Leseerlebnis."],

        "m_annotations_ts_ns_fac":["Verlagsangaben Angaben aus der 
Verlagsmeldung \n\n \n\n  Bete, arbeite und brich auf! : Ein Benediktiner auf 
dem Jakobsweg / von Christoph Müller \n\n \nWas ein Ordensmann auf dem 
Jakobsweg erlebt: \nZum \"Ora et Labora\" gesellt sich bei Benediktinerpater 
Christoph das Pilgern hinzu. Zunächst per Fahrrad, später auf Schusters Rappen, 
erlebt er Freud- und Leidvolles bis Santiago. Gute Beobachtungsgabe, Sinn für 
Situationskomik und die benediktinische Spiritualität, die immer wieder 
durchscheint, machen diesen Pilgerbericht zu einem niveauvollen Leseerlebnis."],

        "m_itemCount_l":1,

        "m_pt_67_ss_ns":["UNSPECIFIED"],

        "m_pt_30_s_ns":"Christoph Müller",

        "m_pt_70_ss_ns":["UNMEDIATED"],

        "m_pt_14_s_ns":"Ill., Kt.",

        "m_pt_16_lang_1_ss_ns":["German"],

        "m_pt_16_lang_2_ss_ns":["Deutsch"],

        "m_pt_16_lang_3_ss_ns":["Tedesco"],

        "m_pt_16_lang_4_ss_ns":["German"],

        "m_pt_16_lang_5_ss_ns":["German"],

        "m_pt_9_s_ns":"205 S.",

        "i_id_l":4294985812,

        "i_manifestationId_l":4294985990,

        "i_libraryId_l":4294967297,

        "i_acquisitionDate_dt_ns":"2016-05-10T00:00:00Z",

        "i_callNumber2_s":"Mü",

        "i_itemNumber_i":18449,

        "i_lent_b":false,

        "i_availableDbValue_i":1,

        "i_availabilityInfo_lang_1_s":"Available",

        "i_availabilityInfo_lang_2_s":"Verfügbar",

        "i_availabilityInfo_lang_3_s":"Disponibile",

        "i_availabilityInfo_lang_4_s":"",

        "i_availabilityInfo_lang_5_s":"",

        "i_printFlag_b_ns":true,

        "cf_1_s_ns":"http://";,

        "_version_":1533904215771971585},

      {

        "type_s":"wemi",

        "text":["wemi",

          "4294985957",

          "Work",

          "Werk",

          "Opera",

          "",

          "",

          "Qumrantexte",

          "Qumrantexte",

          "4294984087",

          "Qumrantexte",

          "Expression",

          "Expression",

          "Espressione",

          "",

          "",

          "- Literaturangaben",

          "Qumrantexte",

          "German",

          "Deutsch",

          "Tedesco",

          "German",

          "German",

          "TEXT",

          "4294985994",

          "Qumran ; Paganini, Simone",

          "Qumran",

          "Book",

          "Buch",

          "Libro",

          "",

          "",

          "Paganini, Simone",

          "1",

          "UNSPECIFIED",

          "Simon und Claudia Paganini",

          "UNMEDIATED",

          "Ill., graph. Darst., Kt.",

          "German",

          "Deutsch",

          "Tedesco",

          "German",

          "German",

          "Bd. 722",

          "Topos-Taschenbücher",

          "184 S.",

          "4294985815",

          "4294985994",

          "4294967297",

          "2016-05-10T00:00:00Z",

          "Pag",

          "18452",

          "false",

          "1",

          "Available",

          "Verfügbar",

          "Disponibile",

          "",

          "",

          "true",

          "http://";],

        "wemiId":"4294985957429498408742949859944294985815",

        "id":"4294985957429498408742949859944294985815",

        "w_id_l":4294985957,

        "w_mediaType_lang_1_s":"Work",

        "w_mediaType_lang_2_s":"Werk",

        "w_mediaType_lang_3_s":"Opera",

        "w_mediaType_lang_4_s":"",

        "w_mediaType_lang_5_s":"",

        "w_displayTitle_s":"Qumrantexte",

        "w_title_s":"Qumrantexte",

        "e_id_l":4294984087,

       "e_displayTitle_s":"Qumrantexte",

        "e_mediaType_lang_1_s":"Expression",

        "e_mediaType_lang_2_s":"Expression",

        "e_mediaType_lang_3_s":"Espressione",

        "e_mediaType_lang_4_s":"",

        "e_mediaType_lang_5_s":"",

        "e_comments_ts_ns":["- Literaturangaben"],

        "e_comments_ts_ns_fac":["- Literaturangaben"],

        "e_title_s":"Qumrantexte",

        "e_pt_16_lang_1_ss_ns":["German"],

        "e_pt_16_lang_2_ss_ns":["Deutsch"],

        "e_pt_16_lang_3_ss_ns":["Tedesco"],

        "e_pt_16_lang_4_ss_ns":["German"],

        "e_pt_16_lang_5_ss_ns":["German"],

        "e_pt_69_ss_ns":["TEXT"],

        "m_id_l":4294985994,

        "m_displayTitle_s":"Qumran ; Paganini, Simone",

        "m_title_s":"Qumran",

        "m_mediaType_lang_1_s":"Book",

        "m_mediaType_lang_2_s":"Buch",

        "m_mediaType_lang_3_s":"Libro",

        "m_mediaType_lang_4_s":"",

        "m_mediaType_lang_5_s":"",

        "m_mainAuthority_s":"Paganini, Simone",

        "m_itemCount_l":1,

        "m_pt_67_ss_ns":["UNSPECIFIED"],

        "m_pt_30_s_ns":"Simon und Claudia Paganini",

        "m_pt_70_ss_ns":["UNMEDIATED"],

        "m_pt_14_s_ns":"Ill., graph. Darst., Kt.",

        "m_pt_16_lang_1_ss_ns":["German"],

        "m_pt_16_lang_2_ss_ns":["Deutsch"],

        "m_pt_16_lang_3_ss_ns":["Tedesco"],

        "m_pt_16_lang_4_ss_ns":["German"],

        "m_pt_16_lang_5_ss_ns":["German"],

        "m_pt_13_ss_ns":["Bd. 722",

          "Topos-Taschenbücher"],

        "m_pt_9_s_ns":"184 S.",

        "i_id_l":4294985815,

        "i_manifestationId_l":4294985994,

        "i_libraryId_l":4294967297,

        "i_acquisitionDate_dt_ns":"2016-05-10T00:00:00Z",

        "i_callNumber2_s":"Pag",

        "i_itemNumber_i":18452,

        "i_lent_b":false,

        "i_availableDbValue_i":1,

        "i_availabilityInfo_lang_1_s":"Available",

        "i_availabilityInfo_lang_2_s":"Verfügbar",

        "i_availabilityInfo_lang_3_s":"Disponibile",

        "i_availabilityInfo_lang_4_s":"",

        "i_availabilityInfo_lang_5_s":"",

        "i_printFlag_b_ns":true,

        "cf_1_s_ns":"http://";,

        "_version_":1533904229178015745}]

  }}






Reply via email to