Hi Solr Team,


The Goal : To calculate the frequency of inventor’s name from a query result

SOLR 8.11.3



I have a field named “inv” (like inventor, i.e. “Jean Dupond”, “Paul
Durand”, etc…), this field is multivalued.



As I do test, I can set the field type as I want, I test string, ngram_text,
text_general without success.



My documents to index are like this:



<add>

<doc>

  <field name=”id”>0001</field>

  <field name=”code”>A</field>

  <field name=”inv”>Paul Durand</field>

  <field name=”inv”>Pierre Richard</field>

</doc>

<doc>

  <field name=”id”>0002</field>

  <field name=”code”>A</field>

  <field name=”inv”>Paul Durand</field>

  <field name=”inv”>André Agassi</field>

</doc>

<doc>

  <field name=”id”>0003</field>

  <field name=”code”>B</field>

  <field name=”inv”>Eric Cantona</field>

  <field name=”inv”>André Agassi</field>

</doc>

…

</add>



I would like to calculate the frequency of each inventors found in a query
result.

i.e. if my query is “q:code=A” then the stats I want will be:



Paul Durant : 2

Pierre Richard : 1

André Agassi : 1



Is it possible to do that directly inside SOLR ?



I try the stats component (with a field type = string) but the result is not
exactly what I want or maybe I use it with wrong parameters…



Any help will be great !



Cordialement, Best Regards

Bruno Mannina

 <http://www.matheo-software.com/> www.matheo-software.com

 <http://www.patent-pulse.com/> www.patent-pulse.com

Mob. +33 0 634 421 817





--
Cet e-mail a été vérifié par le logiciel antivirus d'Avast.
www.avast.com

Reply via email to