lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "G.Long" <jde...@gmail.com>
Subject Re: Field with attribut in the schema.xml ?
Date Thu, 10 May 2012 12:57:37 GMT
You don't have to create a document per field. You have to create a 
document per person.

If inventors, applicants, assignees and attorneys have properties in 
common, you could have a model like :

<field name="name" ...>
<field name="country" ...>
<field name="occupation ...>
...

Then you create a document which contain all of these fields for each 
person.

Regards,
Gary

Le 10/05/2012 14:47, Bruno Mannina a écrit :
> But I have more than 80 000 000 documents with many fields with this 
> kind of description?!
>
> i.e:
> inventor
> applicant
> assignee
> attorney
>
> I must create for each document 4 documents ??
>
> Le 10/05/2012 14:41, G.Long a écrit :
>> When you add data into Solr, you add documents which contain fields.
>> In your case, you should create a document for each of your inventors 
>> with every attribute they could have.
>>
>> Here is an example in Java:
>>
>> SolrInputDocument doc = new SolrInputDocument();
>> doc.addField("inventor", "Rossi");
>> doc.addField("country", "FR");
>> solrServer.add(doc);
>> ...
>> And then you do the same for all your inventors.
>>
>> This way, each doc in your index represents one inventor and you can 
>> query them like:
>> q=inventor:rossi AND country:FR
>>
>> Le 10/05/2012 14:33, Bruno Mannina a écrit :
>>> like that:
>>>
>>> <field name="inventor-country">CH</field>
>>> <field name="inventor-country">FR</field>
>>>
>>> but in this case Ioose the link between inventor and its country?
>>>
>>> if I search an inventor named ROSSI with CH:
>>> q=inventor:rossi and inventor-country=CH
>>>
>>> the I will get this result but it's not correct because Rossi is FR.
>>>
>>> Le 10/05/2012 14:28, G.Long a écrit :
>>>> Hi :)
>>>>
>>>> You could just add a field called country and then add the 
>>>> information to your document.
>>>>
>>>> Regards,
>>>> Gary L.
>>>>
>>>> Le 10/05/2012 14:25, Bruno Mannina a écrit :
>>>>> Dear,
>>>>>
>>>>> I can't find how can I define in my schema.xml a field with this 
>>>>> format?
>>>>>
>>>>> My original format is:
>>>>>
>>>>> <exch:inventors>
>>>>>
>>>>> <exch:inventor>
>>>>> <exch:inventor-name>
>>>>> <name>WEBER WALTER</name>
>>>>> </exch:inventor-name>
>>>>> <residence>
>>>>> <country>CH</country>
>>>>> </residence>
>>>>> </exch:inventor>
>>>>>
>>>>> <exch:inventor>
>>>>> <exch:inventor-name>
>>>>> <name>ROSSI PASCAL</name>
>>>>> </exch:inventor-name>
>>>>> <residence>
>>>>> <country>FR</country>
>>>>> </residence>
>>>>> </exch:inventor>
>>>>>
>>>>> </exch:inventors>
>>>>>
>>>>> I convert it to:
>>>>> ...
>>>>> <field name="inventor">WEBER WALTER</field>
>>>>> <field name="inventor">ROSSI PASCAL</field>
>>>>> ...
>>>>>
>>>>> but how can I add Country code to the field without losing the 
>>>>> link between inventor?
>>>>> Can I use an attribut ?
>>>>>
>>>>> Any idea are welcome :)
>>>>>
>>>>> Thanks,
>>>>> Bruno Mannina
>>>>
>>>>
>>>>
>>>
>>
>>
>>
>


Mime
View raw message