Hi Dorian,
Firstly thanks for your response, but it does not seems to work.
Here is another example, I want to search document with affiliations
contains the NHM (Natural History Museum) of India. So, I want to only
get the document with id=2 :
<doc>
<field name"id">1</field>
<field name="affilliation">NHM, Austria</field>
<field name="affilliation">Annamalai Univ, India</field>
</doc>
<doc>
<field name"id">2</field>
<field name="affilliation">NHM, India</field>
<field name="affilliation">IRD, FRANCE</field>
</doc>
If I implement your solution, ((NMH in affilliation OR India in
affilliation) AND NOT (NMH in affilliation AND India in affilliation) it
doesn't return any document. did I have missed something in you
explanation ?
In the prvious version of my application I used and had a solution with
Oracle Full Text, it seem weird that SOLR cannot provide a solution for
that.
Best regards,
Léo.
Le 15/12/2016 12:44, Dorian Hoxha a écrit :
You should be able to filter "(word1 in field OR word2 in field) AND
NOT(word1 in field AND word2 in field)". Translate that into the right
syntax.
I don't know if lucene is smart enough to execute the filter only once (it
should be i guess).
Makes sense ?
On Thu, Dec 15, 2016 at 12:12 PM, Leo BRUVRY-LAGADEC <Leo.Bruvry.Lagadec@
partenaire-exterieur.ifremer.fr> wrote:
Hi,
I have a multivalued field in my schema called "idx_affilliation".
<field name="idx_affilliation">IFREMER, Ctr Brest, DRO Geosci Marines,
F-29280 Plouzane, France.</field>
<field name="idx_affilliation">Univ Lisbon, Ctr Geofis, P-1269102 Lisbon,
Portugal.</field>
<field name="idx_affilliation">Univ Bretagne Occidentale, Inst Univ
Europeen Mer, Lab Domaines Ocean, F-29280 Plouzane, France.</field>
<field name="idx_affilliation">Total Explorat Prod Geosci Projets Nouveaux
Exper, F-92078 Paris, France.</field>
I want to be able to do a query like: idx_affilliation:(IFREMER Portugal)
and not have this document returned. In other words, I do not want queries
to span individual values for the field.
------------------------------------------------------------
-----------------------------------
Here are some further examples using the document above of how I want this
to work:
idx_affilliation:(IFREMER France) --> Returns it.
idx_affilliation:(IFREMER Plouzane) --> Returns it.
idx_affilliation:("Univ Bretagne Occidentale") --> Returns it.
idx_affilliation:("Univ Lisbon" Portugal) --> Returns it.
idx_affilliation:(IFREMER Portugal) --> DOES NOT RETURN IT.
Does someone known if it's possible to do this ?
Best regards,
Leo.