You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by fabigol <fa...@vialtis.com> on 2015/10/28 22:59:27 UTC

org.apache.solr.common.SolrException: Document is missing mandatory uniqueKey field: id

Hi,
i have a big problem. Solr doesn't index and i have following error:
org.apache.solr.common.SolrException: Document is missing mandatory
uniqueKey field: ID

here my files:

<dataConfig>

	<dataSource name="myvialtis" driver="org.postgresql.Driver"
		url="jdbc:postgresql://localhost:5432/myvialtis" user="postgres"
		password="postgres" readOnly="true" autoCommit="false" batchSize="100000"
		transactionIsolation="TRANSACTION_READ_COMMITTED"
holdability="CLOSE_CURSORS_AT_COMMIT" />


	<document>


		
		
		

		<entity rootEntity="true" name="tiers" dataSource="myvialtis"
			query="select * from bi_solr_tiers" transformer="RegexTransformer">

			<field name="ID" column="tiers_id" />
			<field name="DOC_TYPE" column="tiers_doc_type" />
			<field name="ID_CLIENT" column="tiers_id_client" />
			<field name="NOM_CLIENT" column="tiers_nom_client" />
			<field name="ID_PARENT" column="tiers_id_parent" splitBy="," />
			<field name="ID_PAYS_CLIENT" column="tiers_id_pays_client" />
			<field name="ID_SEGMENT" column="tiers_id_segment" />
			<field name="ID_SALE" column="tiers_id_sale" />
			<field name="NOM_SALE" column="tiers_nom_sale" />

			
			<field name="U_ID_CLIENT" column="tiers_id_client" />
			<field name="U_NOM_CLIENT" column="tiers_nom_client" />
			<field name="U_ID_PARENT" column="tiers_id_parent" splitBy="," />
			<field name="U_ID_PAYS_CLIENT" column="tiers_id_pays_client" />
			<field name="U_ID_SEGMENT" column="tiers_id_segment" />
			<field name="U_ID_SALE" column="tiers_id_sale" />
			<field name="U_NOM_SALE" column="tiers_nom_sale" />

			<entity name="tiers_contrat" dataSource="myvialtis"
cacheKey="contrat_id_client"
				cacheLookup="tiers.tiers_id_client" processor="CachedSqlEntityProcessor"
				query="select * from bi_solr_contrat">

				<field name="ID_PARTENAIRE" column="contrat_id_partenaire" />
				<field name="NOM_PARTENAIRE" column="contrat_nom_partenaire" />
				<field name="TYPE_PARTENAIRE" column="contrat_type_partenaire" />
				<field name="ID_TYPE_SERVICE" column="contrat_id_type_service" />
				<field name="ID_FILIALE" column="contrat_id_filiale" />
				<field name="NOM_FILIALE" column="contrat_nom_filiale" />
				<field name="COMPTE_WEB_POSSIBLE" column="contrat_compte_web_possible"
/>
				<field name="ID_CONTRAT" column="contrat_id_contrat" />
				<field name="ID_STATUT_CONTRAT" column="contrat_id_statut_contrat" />
				<field name="NOM_PRODUIT" column="contrat_nom_produit" />
				<field name="ID_BENEFICIAIRE_CONSO"
column="contrat_id_beneficiaire_conso" />
				<field name="ID_BENEFICIAIRE_HONO" column="contrat_id_beneficiaire_hono"
/>
				<field name="ID_PAYEUR_CONSO" column="contrat_id_payeur_conso" />
				<field name="ID_PAYEUR_HONO" column="contrat_id_payeur_hono" />
				<field name="REF_CONTRAT_TVA" column="contrat_ref_contrat_tva" />
				<field name="PAYS_DEPOT_TVA" column="contrat_pays_depot_tva" />

			</entity>


			<entity name="tiers_carte" dataSource="myvialtis"
				query="select 
				carte_id_client,
				carte_id_carte,
				carte_num_carte,
				carte_carte_active,
				carte_immatriculation,
				carte_nom_flotte
				from bi_solr_carte"
				cacheKey="carte_id_client" cacheLookup="tiers.tiers_id_client"
				processor="CachedSqlEntityProcessor">

				<field name="ID_CARTE" column="carte_id_carte" />
				<field name="NUM_CARTE" column="carte_num_carte" />
				<field name="CARTE_ACTIVE" column="carte_carte_active" />
				<field name="IMMATRICULATION" column="carte_immatriculation" />
				<field name="NOM_FLOTTE" column="carte_nom_flotte" />
			</entity>

			<entity name="tiers_invoice" dataSource="myvialtis"
cacheKey="contrat_id_client"
				cacheLookup="tiers.tiers_id_client" processor="CachedSqlEntityProcessor"
				query="select 
						distinct bi_solr_invoice.*, 
						bi_solr_contrat.contrat_id_client
						from bi_solr_invoice 
						inner join bi_solr_invoice_cnt on
bi_solr_invoice.invoice_numero_facture=bi_solr_invoice_cnt.numero_facture 
						inner join bi_solr_contrat on
bi_solr_contrat.contrat_id_contrat=bi_solr_invoice_cnt.id_contrat
						where bi_solr_invoice.invoice_date_emission + interval '6 months' &gt;
date_trunc('day',current_date)">

				<field name="NUMERO_FACTURE" column="invoice_numero_facture" />
				<field name="ID_BENEFICIAIRE" column="invoice_id_beneficiaire" />
				<field name="ID_PAYEUR" column="invoice_id_payeur" />
				<field name="DATE_EMISSION" column="invoice_date_emission" />
				<field name="DATE_EMISSION_DD_MM_YYYY"
column="invoice_date_emission_dd_mm_yyyy" />
				<field name="DATE_EMISSION_MM_YYYY"
column="invoice_date_emission_mm_yyyy" />
				<field name="DATE_EMISSION_YYYY" column="invoice_date_emission_yyyy" />
				<field name="DEVISE" column="invoice_devise" />
				<field name="INVOICE_TOTAL_HT" column="invoice_total_ht" />
				<field name="INVOICE_TOTAL_TVA" column="invoice_total_tva" />
				<field name="INVOICE_TOTAL_TTC" column="invoice_total_ttc" />
			</entity>

			<entity name="tiers_conso" dataSource="myvialtis"
cacheKey="conso_id_client"
				cacheLookup="tiers.tiers_id_client" processor="CachedSqlEntityProcessor"
				query="select 
						conso_id_client,
						conso_numero_carte,
						conso_immatriculation,
						conso_nom_flotte,
						conso_id_conso,
						conso_gare_entree,
						conso_gare_sortie,
						conso_autoroute_entree,
						conso_autoroute_sortie,
						conso_sca_entree,
						conso_sca_sortie,
						conso_statut
						from bi_solr_transaction where conso_id_client is not null
						and (conso_type_transaction is null or conso_type_transaction !=
'1')">


				<field name="NUM_CARTE" column="conso_numero_carte" />
				<field name="IMMATRICULATION" column="conso_immatriculation" />
				<field name="NOM_FLOTTE" column="conso_nom_flotte" />
				<field name="ID_CONSO" column="conso_id_conso" />
				<field name="NOM_GARE_ORIGINE" column="conso_gare_entree" />
				<field name="NOM_GARE_CIBLE" column="conso_gare_sortie" />
				<field name="NOM_AUTO_ORIGINE" column="conso_autoroute_entre" />
				<field name="NOM_AUTO_CIBLE" column="conso_autoroute_sortie" />
				<field name="NOM_SCA_ORIGINE" column="conso_sca_entree" />
				<field name="NOM_SCA_CIBLE" column="conso_sca_sortie" />
				<field name="STATUT_CONSO" column="conso_statut" />

			</entity>

			<entity name="tiers_conso_remise" dataSource="myvialtis"
				cacheKey="conso_id_client" cacheLookup="tiers.tiers_id_client"
				processor="CachedSqlEntityProcessor"
				query="select 
						conso_id_client,
						conso_numero_carte,
						conso_immatriculation,
						conso_nom_flotte,
						conso_id_conso,
						conso_gare_entree,
						conso_gare_sortie,
						conso_autoroute_entree,
						conso_autoroute_sortie,
						conso_sca_entree,
						conso_sca_sortie,
						conso_statut
						from bi_solr_transaction where conso_id_client is not null
						and conso_type_transaction != '3'">


				<field name="NUM_CARTE" column="conso_numero_carte" />
				<field name="IMMATRICULATION" column="conso_immatriculation" />
				<field name="NOM_FLOTTE" column="conso_nom_flotte" />
				<field name="ID_CONSO" column="conso_id_conso" />
				<field name="NOM_GARE_ORIGINE" column="conso_gare_entree" />
				<field name="NOM_GARE_CIBLE" column="conso_gare_sortie" />
				<field name="NOM_AUTO_ORIGINE" column="conso_autoroute_entre" />
				<field name="NOM_AUTO_CIBLE" column="conso_autoroute_sortie" />
				<field name="NOM_SCA_ORIGINE" column="conso_sca_entree" />
				<field name="NOM_SCA_CIBLE" column="conso_sca_sortie" />
				<field name="STATUT_CONSO" column="conso_statut" />

			</entity>

			<entity name="tiers_remise" dataSource="myvialtis"
cacheKey="remise_id_client"
				cacheLookup="tiers.tiers_id_client" processor="CachedSqlEntityProcessor"
				query="select 
						remise_id_client,
						remise_numero_carte,
						remise_immatriculation,
						remise_nom_flotte,
						remise_id_remise,
						remise_sca_entree
						from bi_solr_remise where remise_id_client is not null">


				<field name="NUM_CARTE" column="remise_numero_carte" />
				<field name="IMMATRICULATION" column="remise_immatriculation" />
				<field name="NOM_FLOTTE" column="remise_nom_flotte" />
				<field name="ID_REMISE" column="remise_id_remise" />
				<field name="NOM_SCA_ORIGINE" column="remise_sca_entree" />

			</entity>

		</entity>


	</document>

</dataConfig>


please help me



--
View this message in context: http://lucene.472066.n3.nabble.com/org-apache-solr-common-SolrException-Document-is-missing-mandatory-uniqueKey-field-id-tp4237067.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: org.apache.solr.common.SolrException: Document is missing mandatory uniqueKey field: id

Posted by fabigol <fa...@vialtis.com>.
hi,
if i understand well.
In the configuration following:
<entity rootEntity="true" name="tiers" dataSource="myvialtis"
			query="select * from bi_solr_tiers" transformer="RegexTransformer">

			<field name="ID" column="tiers_id" />
			<field name="DOC_TYPE" column="tiers_doc_type" />
			<field name="ID_CLIENT" column="tiers_id_client" />
			<field name="NOM_CLIENT" column="tiers_nom_client" />
			<field name="ID_PARENT" column="tiers_id_parent" splitBy="," />
			<field name="ID_PAYS_CLIENT" column="tiers_id_pays_client" />
			<field name="ID_SEGMENT" column="tiers_id_segment" />
			<field name="ID_SALE" column="tiers_id_sale" />
			<field name="NOM_SALE" column="tiers_nom_sale" />

			
			<field name="U_ID_CLIENT" column="tiers_id_client" />
			<field name="U_NOM_CLIENT" column="tiers_nom_client" />
			<field name="U_ID_PARENT" column="tiers_id_parent" splitBy="," />
			<field name="U_ID_PAYS_CLIENT" column="tiers_id_pays_client" />
			<field name="U_ID_SEGMENT" column="tiers_id_segment" />
			<field name="U_ID_SALE" column="tiers_id_sale" />
			<field name="U_NOM_SALE" column="tiers_nom_sale" />

			<entity name="tiers_contrat" dataSource="myvialtis"
cacheKey="contrat_id_client"
				cacheLookup="tiers.tiers_id_client" processor="CachedSqlEntityProcessor"
				query="select * from bi_solr_contrat">

				<field name="ID_PARTENAIRE" column="contrat_id_partenaire" />
				<field name="NOM_PARTENAIRE" column="contrat_nom_partenaire" />
				<field name="TYPE_PARTENAIRE" column="contrat_type_partenaire" />
				<field name="ID_TYPE_SERVICE" column="contrat_id_type_service" />
				<field name="ID_FILIALE" column="contrat_id_filiale" />
				<field name="NOM_FILIALE" column="contrat_nom_filiale" />
				<field name="COMPTE_WEB_POSSIBLE" column="contrat_compte_web_possible"
/>
				<field name="ID_CONTRAT" column="contrat_id_contrat" />
				<field name="ID_STATUT_CONTRAT" column="contrat_id_statut_contrat" />
				<field name="NOM_PRODUIT" column="contrat_nom_produit" />
				<field name="ID_BENEFICIAIRE_CONSO"
column="contrat_id_beneficiaire_conso" />
				<field name="ID_BENEFICIAIRE_HONO" column="contrat_id_beneficiaire_hono"
/>
				<field name="ID_PAYEUR_CONSO" column="contrat_id_payeur_conso" />
				<field name="ID_PAYEUR_HONO" column="contrat_id_payeur_hono" />
				<field name="REF_CONTRAT_TVA" column="contrat_ref_contrat_tva" />
				<field name="PAYS_DEPOT_TVA" column="contrat_pays_depot_tva" />

			</entity>

it missed the mapping for docType and ID.
I catch this project. this said me that it works. but i think it's not true
because i don't underdand if it missed that???



--
View this message in context: http://lucene.472066.n3.nabble.com/org-apache-solr-common-SolrException-Document-is-missing-mandatory-uniqueKey-field-id-tp4237067p4237588.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: org.apache.solr.common.SolrException: Document is missing mandatory uniqueKey field: id

Posted by Tom Evans <te...@googlemail.com>.
On Mon, Nov 2, 2015 at 1:38 PM, fabigol <fa...@vialtis.com> wrote:
> Thank
> All works.
> I have 2 last questions:
> How can i put 0 by defaults " clean" during a indexation?
>
> To conclure, i wand to understand:
>
>
> Requests: 7 (1/s), Fetched: 452447 (45245/s), Skipped: 0, Processed: 17433
> (1743/s)
>
> What is the "requests"?
> What is 'Fetched"?
> What is "Processed"?
>
> Thank again for your answer
>

Depends upon how DIH is configured - different things return different
numbers. For a SqlEntityProcessor, "Requests" is the number of SQL
queries, "Fetched" is the number of rows read from those queries, and
"Processed" is the number of documents processed by SOLR.

> For the second question, i try:
>                 <lst name="invariants">
>                         <str name="clean">false</str>
>                 </lst>
>
> and
>                         <bool name="commit">true</bool>
>                         <bool name="clean">false</bool>
>

Putting things in "invariants" overrides whatever is passed for that
parameter in the request parameters. By putting "<bool
name="clean">false</bool>" in invariants, you are making it impossible
to clean + index as part of DIH, because "clean" is always false.

Cheers

Tom

Re: org.apache.solr.common.SolrException: Document is missing mandatory uniqueKey field: id

Posted by fabigol <fa...@vialtis.com>.
Thank 
All works.
I have 2 last questions:
How can i put 0 by defaults " clean" during a indexation?

To conclure, i wand to understand:
 

Requests: 7 (1/s), Fetched: 452447 (45245/s), Skipped: 0, Processed: 17433
(1743/s)

What is the "requests"?
What is 'Fetched"?
What is "Processed"?

Thank again for your answer



--
View this message in context: http://lucene.472066.n3.nabble.com/org-apache-solr-common-SolrException-Document-is-missing-mandatory-uniqueKey-field-id-tp4237067p4237693.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: org.apache.solr.common.SolrException: Document is missing mandatory uniqueKey field: id

Posted by Erick Erickson <er...@gmail.com>.
When you have a <uniqueKey> defined in schema.xml, that
is a field in the doc that must exist in every doc you send
to Solr.

Actually, you'll see in the definition for the <uniqueKey> field that
it has required="true" set.

Assuming you have a column "carte_id" being selected for all
docs inserted into Solr that should probably work.

My guess is that at least some records do NOT have this value set.

Best,
Erick

On Thu, Oct 29, 2015 at 12:54 AM, fabigol <fa...@vialtis.com> wrote:
> hi,
> thank to your reply
> When you says
> 'You must have a field labeled "id" in the doc sent to Solr'. it's in the
> response of the select that i must get an "id"?  i must write "select
> 'something' as ID...." is it good???
> in schema.xml i have the following line
> <uniqueKey>ID</uniqueKey>
>  end
> my data-import file i have
> <field name="ID" column="carte_id" />
>
> I think that i must map the column ID in my file data-import. I make the
> mapping helping with the "select something as id..."
> is it good?
>
>
>
> --
> View this message in context: http://lucene.472066.n3.nabble.com/org-apache-solr-common-SolrException-Document-is-missing-mandatory-uniqueKey-field-id-tp4237067p4237147.html
> Sent from the Solr - User mailing list archive at Nabble.com.

Re: org.apache.solr.common.SolrException: Document is missing mandatory uniqueKey field: id

Posted by Shawn Heisey <ap...@elyograg.org>.
On 10/29/2015 1:54 AM, fabigol wrote:
> hi,
> thank to your reply
> When you says 
> 'You must have a field labeled "id" in the doc sent to Solr'. it's in the
> response of the select that i must get an "id"?  i must write "select
> 'something' as ID...." is it good???
> in schema.xml i have the following line
> <uniqueKey>ID</uniqueKey>
>  end
> my data-import file i have
> <field name="ID" column="carte_id" />
>
> I think that i must map the column ID in my file data-import. I make the
> mapping helping with the "select something as id..."
> is it good?

Solr's schema has the field, the problem is that the result from the
database query, after the dataimport handler is done with it, does not
contain the ID field for at least one document.  In your DIH config, I
saw this:

<field name="ID" column="tiers_id" />

Either that field mapping isn't working, or the tiers_id db column is
NULL/missing on at least one of your database rows, which results in the
ID field being absent from the Solr document that the dataimport handler
sends to Solr.

Thanks,
Shawn


Re: org.apache.solr.common.SolrException: Document is missing mandatory uniqueKey field: id

Posted by fabigol <fa...@vialtis.com>.
hi,
thank to your reply
When you says 
'You must have a field labeled "id" in the doc sent to Solr'. it's in the
response of the select that i must get an "id"?  i must write "select
'something' as ID...." is it good???
in schema.xml i have the following line
<uniqueKey>ID</uniqueKey>
 end
my data-import file i have
<field name="ID" column="carte_id" />

I think that i must map the column ID in my file data-import. I make the
mapping helping with the "select something as id..."
is it good?



--
View this message in context: http://lucene.472066.n3.nabble.com/org-apache-solr-common-SolrException-Document-is-missing-mandatory-uniqueKey-field-id-tp4237067p4237147.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: org.apache.solr.common.SolrException: Document is missing mandatory uniqueKey field: id

Posted by Erick Erickson <er...@gmail.com>.
It's just what the error says. You must have a field labeled "id" in the doc
sent to Solr. You can use a different field if you change your schema.xml
<uniqueKey> entry to some other name that is the analog to the primary
key in a DB. Or you can change your config to select an "id" field (case
matters) for each record sent to Solr.

Best,
Erick

On Wed, Oct 28, 2015 at 2:59 PM, fabigol <fa...@vialtis.com> wrote:
> Hi,
> i have a big problem. Solr doesn't index and i have following error:
> org.apache.solr.common.SolrException: Document is missing mandatory
> uniqueKey field: ID
>
> here my files:
>
> <dataConfig>
>
>         <dataSource name="myvialtis" driver="org.postgresql.Driver"
>                 url="jdbc:postgresql://localhost:5432/myvialtis" user="postgres"
>                 password="postgres" readOnly="true" autoCommit="false" batchSize="100000"
>                 transactionIsolation="TRANSACTION_READ_COMMITTED"
> holdability="CLOSE_CURSORS_AT_COMMIT" />
>
>
>         <document>
>
>
>
>
>
>
>                 <entity rootEntity="true" name="tiers" dataSource="myvialtis"
>                         query="select * from bi_solr_tiers" transformer="RegexTransformer">
>
>                         <field name="ID" column="tiers_id" />
>                         <field name="DOC_TYPE" column="tiers_doc_type" />
>                         <field name="ID_CLIENT" column="tiers_id_client" />
>                         <field name="NOM_CLIENT" column="tiers_nom_client" />
>                         <field name="ID_PARENT" column="tiers_id_parent" splitBy="," />
>                         <field name="ID_PAYS_CLIENT" column="tiers_id_pays_client" />
>                         <field name="ID_SEGMENT" column="tiers_id_segment" />
>                         <field name="ID_SALE" column="tiers_id_sale" />
>                         <field name="NOM_SALE" column="tiers_nom_sale" />
>
>
>                         <field name="U_ID_CLIENT" column="tiers_id_client" />
>                         <field name="U_NOM_CLIENT" column="tiers_nom_client" />
>                         <field name="U_ID_PARENT" column="tiers_id_parent" splitBy="," />
>                         <field name="U_ID_PAYS_CLIENT" column="tiers_id_pays_client" />
>                         <field name="U_ID_SEGMENT" column="tiers_id_segment" />
>                         <field name="U_ID_SALE" column="tiers_id_sale" />
>                         <field name="U_NOM_SALE" column="tiers_nom_sale" />
>
>                         <entity name="tiers_contrat" dataSource="myvialtis"
> cacheKey="contrat_id_client"
>                                 cacheLookup="tiers.tiers_id_client" processor="CachedSqlEntityProcessor"
>                                 query="select * from bi_solr_contrat">
>
>                                 <field name="ID_PARTENAIRE" column="contrat_id_partenaire" />
>                                 <field name="NOM_PARTENAIRE" column="contrat_nom_partenaire" />
>                                 <field name="TYPE_PARTENAIRE" column="contrat_type_partenaire" />
>                                 <field name="ID_TYPE_SERVICE" column="contrat_id_type_service" />
>                                 <field name="ID_FILIALE" column="contrat_id_filiale" />
>                                 <field name="NOM_FILIALE" column="contrat_nom_filiale" />
>                                 <field name="COMPTE_WEB_POSSIBLE" column="contrat_compte_web_possible"
> />
>                                 <field name="ID_CONTRAT" column="contrat_id_contrat" />
>                                 <field name="ID_STATUT_CONTRAT" column="contrat_id_statut_contrat" />
>                                 <field name="NOM_PRODUIT" column="contrat_nom_produit" />
>                                 <field name="ID_BENEFICIAIRE_CONSO"
> column="contrat_id_beneficiaire_conso" />
>                                 <field name="ID_BENEFICIAIRE_HONO" column="contrat_id_beneficiaire_hono"
> />
>                                 <field name="ID_PAYEUR_CONSO" column="contrat_id_payeur_conso" />
>                                 <field name="ID_PAYEUR_HONO" column="contrat_id_payeur_hono" />
>                                 <field name="REF_CONTRAT_TVA" column="contrat_ref_contrat_tva" />
>                                 <field name="PAYS_DEPOT_TVA" column="contrat_pays_depot_tva" />
>
>                         </entity>
>
>
>                         <entity name="tiers_carte" dataSource="myvialtis"
>                                 query="select
>                                 carte_id_client,
>                                 carte_id_carte,
>                                 carte_num_carte,
>                                 carte_carte_active,
>                                 carte_immatriculation,
>                                 carte_nom_flotte
>                                 from bi_solr_carte"
>                                 cacheKey="carte_id_client" cacheLookup="tiers.tiers_id_client"
>                                 processor="CachedSqlEntityProcessor">
>
>                                 <field name="ID_CARTE" column="carte_id_carte" />
>                                 <field name="NUM_CARTE" column="carte_num_carte" />
>                                 <field name="CARTE_ACTIVE" column="carte_carte_active" />
>                                 <field name="IMMATRICULATION" column="carte_immatriculation" />
>                                 <field name="NOM_FLOTTE" column="carte_nom_flotte" />
>                         </entity>
>
>                         <entity name="tiers_invoice" dataSource="myvialtis"
> cacheKey="contrat_id_client"
>                                 cacheLookup="tiers.tiers_id_client" processor="CachedSqlEntityProcessor"
>                                 query="select
>                                                 distinct bi_solr_invoice.*,
>                                                 bi_solr_contrat.contrat_id_client
>                                                 from bi_solr_invoice
>                                                 inner join bi_solr_invoice_cnt on
> bi_solr_invoice.invoice_numero_facture=bi_solr_invoice_cnt.numero_facture
>                                                 inner join bi_solr_contrat on
> bi_solr_contrat.contrat_id_contrat=bi_solr_invoice_cnt.id_contrat
>                                                 where bi_solr_invoice.invoice_date_emission + interval '6 months' &gt;
> date_trunc('day',current_date)">
>
>                                 <field name="NUMERO_FACTURE" column="invoice_numero_facture" />
>                                 <field name="ID_BENEFICIAIRE" column="invoice_id_beneficiaire" />
>                                 <field name="ID_PAYEUR" column="invoice_id_payeur" />
>                                 <field name="DATE_EMISSION" column="invoice_date_emission" />
>                                 <field name="DATE_EMISSION_DD_MM_YYYY"
> column="invoice_date_emission_dd_mm_yyyy" />
>                                 <field name="DATE_EMISSION_MM_YYYY"
> column="invoice_date_emission_mm_yyyy" />
>                                 <field name="DATE_EMISSION_YYYY" column="invoice_date_emission_yyyy" />
>                                 <field name="DEVISE" column="invoice_devise" />
>                                 <field name="INVOICE_TOTAL_HT" column="invoice_total_ht" />
>                                 <field name="INVOICE_TOTAL_TVA" column="invoice_total_tva" />
>                                 <field name="INVOICE_TOTAL_TTC" column="invoice_total_ttc" />
>                         </entity>
>
>                         <entity name="tiers_conso" dataSource="myvialtis"
> cacheKey="conso_id_client"
>                                 cacheLookup="tiers.tiers_id_client" processor="CachedSqlEntityProcessor"
>                                 query="select
>                                                 conso_id_client,
>                                                 conso_numero_carte,
>                                                 conso_immatriculation,
>                                                 conso_nom_flotte,
>                                                 conso_id_conso,
>                                                 conso_gare_entree,
>                                                 conso_gare_sortie,
>                                                 conso_autoroute_entree,
>                                                 conso_autoroute_sortie,
>                                                 conso_sca_entree,
>                                                 conso_sca_sortie,
>                                                 conso_statut
>                                                 from bi_solr_transaction where conso_id_client is not null
>                                                 and (conso_type_transaction is null or conso_type_transaction !=
> '1')">
>
>
>                                 <field name="NUM_CARTE" column="conso_numero_carte" />
>                                 <field name="IMMATRICULATION" column="conso_immatriculation" />
>                                 <field name="NOM_FLOTTE" column="conso_nom_flotte" />
>                                 <field name="ID_CONSO" column="conso_id_conso" />
>                                 <field name="NOM_GARE_ORIGINE" column="conso_gare_entree" />
>                                 <field name="NOM_GARE_CIBLE" column="conso_gare_sortie" />
>                                 <field name="NOM_AUTO_ORIGINE" column="conso_autoroute_entre" />
>                                 <field name="NOM_AUTO_CIBLE" column="conso_autoroute_sortie" />
>                                 <field name="NOM_SCA_ORIGINE" column="conso_sca_entree" />
>                                 <field name="NOM_SCA_CIBLE" column="conso_sca_sortie" />
>                                 <field name="STATUT_CONSO" column="conso_statut" />
>
>                         </entity>
>
>                         <entity name="tiers_conso_remise" dataSource="myvialtis"
>                                 cacheKey="conso_id_client" cacheLookup="tiers.tiers_id_client"
>                                 processor="CachedSqlEntityProcessor"
>                                 query="select
>                                                 conso_id_client,
>                                                 conso_numero_carte,
>                                                 conso_immatriculation,
>                                                 conso_nom_flotte,
>                                                 conso_id_conso,
>                                                 conso_gare_entree,
>                                                 conso_gare_sortie,
>                                                 conso_autoroute_entree,
>                                                 conso_autoroute_sortie,
>                                                 conso_sca_entree,
>                                                 conso_sca_sortie,
>                                                 conso_statut
>                                                 from bi_solr_transaction where conso_id_client is not null
>                                                 and conso_type_transaction != '3'">
>
>
>                                 <field name="NUM_CARTE" column="conso_numero_carte" />
>                                 <field name="IMMATRICULATION" column="conso_immatriculation" />
>                                 <field name="NOM_FLOTTE" column="conso_nom_flotte" />
>                                 <field name="ID_CONSO" column="conso_id_conso" />
>                                 <field name="NOM_GARE_ORIGINE" column="conso_gare_entree" />
>                                 <field name="NOM_GARE_CIBLE" column="conso_gare_sortie" />
>                                 <field name="NOM_AUTO_ORIGINE" column="conso_autoroute_entre" />
>                                 <field name="NOM_AUTO_CIBLE" column="conso_autoroute_sortie" />
>                                 <field name="NOM_SCA_ORIGINE" column="conso_sca_entree" />
>                                 <field name="NOM_SCA_CIBLE" column="conso_sca_sortie" />
>                                 <field name="STATUT_CONSO" column="conso_statut" />
>
>                         </entity>
>
>                         <entity name="tiers_remise" dataSource="myvialtis"
> cacheKey="remise_id_client"
>                                 cacheLookup="tiers.tiers_id_client" processor="CachedSqlEntityProcessor"
>                                 query="select
>                                                 remise_id_client,
>                                                 remise_numero_carte,
>                                                 remise_immatriculation,
>                                                 remise_nom_flotte,
>                                                 remise_id_remise,
>                                                 remise_sca_entree
>                                                 from bi_solr_remise where remise_id_client is not null">
>
>
>                                 <field name="NUM_CARTE" column="remise_numero_carte" />
>                                 <field name="IMMATRICULATION" column="remise_immatriculation" />
>                                 <field name="NOM_FLOTTE" column="remise_nom_flotte" />
>                                 <field name="ID_REMISE" column="remise_id_remise" />
>                                 <field name="NOM_SCA_ORIGINE" column="remise_sca_entree" />
>
>                         </entity>
>
>                 </entity>
>
>
>         </document>
>
> </dataConfig>
>
>
> please help me
>
>
>
> --
> View this message in context: http://lucene.472066.n3.nabble.com/org-apache-solr-common-SolrException-Document-is-missing-mandatory-uniqueKey-field-id-tp4237067.html
> Sent from the Solr - User mailing list archive at Nabble.com.

Re: org.apache.solr.common.SolrException: Document is missing mandatory uniqueKey field: id

Posted by fabigol <fa...@vialtis.com>.
For the second question, i try:
		<lst name="invariants">
			<str name="clean">false</str>
		</lst>

and 
			<bool name="commit">true</bool>
			<bool name="clean">false</bool>

in solrConfig.xml but without success?



--
View this message in context: http://lucene.472066.n3.nabble.com/org-apache-solr-common-SolrException-Document-is-missing-mandatory-uniqueKey-field-id-tp4237067p4237699.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: org.apache.solr.common.SolrException: Document is missing mandatory uniqueKey field: id

Posted by Mikhail Khludnev <mk...@griddynamics.com>.
Try to remove http://wiki.apache.org/solr/SchemaXml#The_Unique_Key_Field

On Fri, Oct 30, 2015 at 12:51 PM, fabigol <fa...@vialtis.com>
wrote:

> Hi,
> great thank for your replies.
> I undated that you said me the same thing. Is it right?
> In some record, it is missing the id_tiers?
>
> I have a question, how is it possible that the mapping does not work?
>
> I'm going to check my data (response request). I must have the field
> id_fields not empty?
>
> But, i had tested required=false for the ID, and i had the same error. is
> it
> logic?
>
> Thank you again for your help. It allows me to better understand SOLR
>
>
>
> --
> View this message in context:
> http://lucene.472066.n3.nabble.com/org-apache-solr-common-SolrException-Document-is-missing-mandatory-uniqueKey-field-id-tp4237067p4237341.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>



-- 
Sincerely yours
Mikhail Khludnev
Principal Engineer,
Grid Dynamics

<http://www.griddynamics.com>
<mk...@griddynamics.com>

Re: org.apache.solr.common.SolrException: Document is missing mandatory uniqueKey field: id

Posted by fabigol <fa...@vialtis.com>.
Hi, 
great thank for your replies.
I undated that you said me the same thing. Is it right?
In some record, it is missing the id_tiers?

I have a question, how is it possible that the mapping does not work?

I'm going to check my data (response request). I must have the field
id_fields not empty?

But, i had tested required=false for the ID, and i had the same error. is it
logic?

Thank you again for your help. It allows me to better understand SOLR



--
View this message in context: http://lucene.472066.n3.nabble.com/org-apache-solr-common-SolrException-Document-is-missing-mandatory-uniqueKey-field-id-tp4237067p4237341.html
Sent from the Solr - User mailing list archive at Nabble.com.